source: src/tests/sched-ext-parse.c @ d67cdb7

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since d67cdb7 was d67cdb7, checked in by Peter A. Buhr <pabuhr@…>, 7 years ago

merge

  • Property mode set to 100644
File size: 1.3 KB
Line 
1#include <monitor>
2
3monitor M {};
4
5M a;
6
7void f1( M & mutex a );
8void f2( M & mutex a );
9void f2( M & mutex a, M & mutex b );
10void f3( M & mutex a );
11void f3( M & mutex a, M & mutex b );
12void f3( M & mutex a, M & mutex b, M & mutex c );
13
14void foo() {
15
16        //---------------------------------------
17        waitfor( f1, a ) {
18                1;
19        }
20
21        //---------------------------------------
22        waitfor( f1, a ) {
23                2;
24        }
25        waitfor( f2, a ) {
26                3;
27        }
28
29        //---------------------------------------
30        when( 1 < 3 ) waitfor( f2, a, a ) {
31                4;
32        }
33        or timeout( 100 ) {
34                5;
35        }
36
37        //---------------------------------------
38        when( 2 < 3 ) waitfor( f3, a ) {
39                5;
40        }
41        or else {
42                6;
43        }
44
45        //---------------------------------------
46        when( 3 < 3 ) waitfor( f3, a, a ) {
47                7;
48        }
49        or when( 4 < 3 ) timeout( 101 ) {
50                8;
51        }
52        or when( 5 < 3 ) else {
53                9;
54        }
55
56        //---------------------------------------
57        when( 6 < 3 ) waitfor( f3, a, a, a ) {
58                10;
59        }
60        or when( 7 < 3 ) waitfor( f1, a  ) {
61                11;
62        }
63        or else {
64                12;
65        }
66
67        //---------------------------------------
68        when( 8 < 3 ) waitfor( f3, a, a ) {
69                13;
70        }
71        or waitfor( f1, a  ) {
72                14;
73        }
74        or when( 9 < 3 ) timeout( 102 ) {
75                15;
76        }
77
78        //---------------------------------------
79        when( 10 < 3 ) waitfor( f1, a ) {
80                16;
81        }
82        or waitfor( f2, a, a ) {
83                17;
84        }
85        or timeout( 103 ) {
86                18;
87        }
88        or when( 11 < 3 ) else {
89                19;
90        }
91}
92
93int main() {
94
95}
Note: See TracBrowser for help on using the repository browser.