- File:
-
- 1 edited
-
tests/unified_locking/timeout_lock.cfa (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/unified_locking/timeout_lock.cfa
rb984d54 r7404cdc 6 6 #include "kernel.cfa" 7 7 8 multiple_acquisition_lock m, n; 9 condition_variable( multiple_acquisition_lock ) c_m, c_n; 8 multiple_acquisition_lock m; 9 condition_variable( multiple_acquisition_lock ) c_m; 10 11 semaphore s; // used for barrier like behaviour 10 12 11 13 const unsigned int NoOfTimes = 20; 12 14 13 void block() { // used for barrier like behaviour 14 lock(n); 15 if (empty( c_n )) { 16 wait( c_n, n ); 15 void block() { 16 if (s.count == 0) { 17 P(s); 17 18 } else { 18 notify_one( c_n);19 V(s); 19 20 } 20 unlock(n);21 21 } 22 22 … … 80 80 81 81 printf("Start Test 2: testing timeout vs signalling with varying timeout durations\n"); 82 s{ 0 }; 82 83 { 83 84 T1 t1;
Note:
See TracChangeset
for help on using the changeset viewer.