[206de5a] | 1 | //---------------------------------------------------------------------------------------- |
---|
| 2 | //---------------------------------------------------------------------------------------- |
---|
| 3 | // |
---|
| 4 | // DEPRECATED TEST |
---|
| 5 | // DIFFERS BETWEEN DEBUG AND RELEASE |
---|
| 6 | // |
---|
| 7 | //---------------------------------------------------------------------------------------- |
---|
| 8 | //---------------------------------------------------------------------------------------- |
---|
| 9 | |
---|
[73abe95] | 10 | #include <monitor.hfa> |
---|
[9f5ecf5] | 11 | |
---|
| 12 | monitor M {}; |
---|
| 13 | |
---|
| 14 | M a; |
---|
| 15 | |
---|
| 16 | void f1( M & mutex a ); |
---|
| 17 | void f2( M & mutex a ); |
---|
| 18 | void f2( M & mutex a, M & mutex b ); |
---|
| 19 | void f3( M & mutex a ); |
---|
| 20 | void f3( M & mutex a, M & mutex b ); |
---|
| 21 | void f3( M & mutex a, M & mutex b, M & mutex c ); |
---|
| 22 | |
---|
| 23 | void foo() { |
---|
| 24 | |
---|
| 25 | //--------------------------------------- |
---|
| 26 | waitfor( f1, a ) { |
---|
[8f98b78] | 27 | 1; |
---|
[9f5ecf5] | 28 | } |
---|
| 29 | |
---|
| 30 | //--------------------------------------- |
---|
| 31 | waitfor( f1, a ) { |
---|
| 32 | 2; |
---|
| 33 | } |
---|
| 34 | waitfor( f2, a ) { |
---|
| 35 | 3; |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | //--------------------------------------- |
---|
| 39 | when( 1 < 3 ) waitfor( f2, a, a ) { |
---|
| 40 | 4; |
---|
| 41 | } |
---|
| 42 | or timeout( 100 ) { |
---|
| 43 | 5; |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | //--------------------------------------- |
---|
| 47 | when( 2 < 3 ) waitfor( f3, a ) { |
---|
| 48 | 5; |
---|
| 49 | } |
---|
| 50 | or else { |
---|
| 51 | 6; |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | //--------------------------------------- |
---|
| 55 | when( 3 < 3 ) waitfor( f3, a, a ) { |
---|
| 56 | 7; |
---|
| 57 | } |
---|
| 58 | or when( 4 < 3 ) timeout( 101 ) { |
---|
| 59 | 8; |
---|
| 60 | } |
---|
| 61 | or when( 5 < 3 ) else { |
---|
| 62 | 9; |
---|
| 63 | } |
---|
| 64 | |
---|
| 65 | //--------------------------------------- |
---|
| 66 | when( 6 < 3 ) waitfor( f3, a, a, a ) { |
---|
| 67 | 10; |
---|
| 68 | } |
---|
| 69 | or when( 7 < 3 ) waitfor( f1, a ) { |
---|
| 70 | 11; |
---|
| 71 | } |
---|
| 72 | or else { |
---|
| 73 | 12; |
---|
| 74 | } |
---|
| 75 | |
---|
| 76 | //--------------------------------------- |
---|
| 77 | when( 8 < 3 ) waitfor( f3, a, a ) { |
---|
| 78 | 13; |
---|
| 79 | } |
---|
| 80 | or waitfor( f1, a ) { |
---|
| 81 | 14; |
---|
| 82 | } |
---|
| 83 | or when( 9 < 3 ) timeout( 102 ) { |
---|
| 84 | 15; |
---|
| 85 | } |
---|
| 86 | |
---|
| 87 | //--------------------------------------- |
---|
| 88 | when( 10 < 3 ) waitfor( f1, a ) { |
---|
| 89 | 16; |
---|
| 90 | } |
---|
[310e5b7] | 91 | or waitfor( f2, a, a ) { |
---|
[9f5ecf5] | 92 | 17; |
---|
| 93 | } |
---|
| 94 | or timeout( 103 ) { |
---|
| 95 | 18; |
---|
| 96 | } |
---|
| 97 | or when( 11 < 3 ) else { |
---|
| 98 | 19; |
---|
| 99 | } |
---|
| 100 | } |
---|
| 101 | |
---|
| 102 | int main() { |
---|
| 103 | |
---|
| 104 | } |
---|