source: tests/concurrency/unified_locking/test_debug.cfa @ b5e3a80

Last change on this file since b5e3a80 was c26bea2a, checked in by Peter A. Buhr <pabuhr@…>, 18 months ago

first attempt at renaming directory tests/concurrent to tests/concurrency to harmonize with other concurrency directory names

  • Property mode set to 100644
File size: 493 bytes
Line 
1#include "locks.hfa"
2
3fast_block_lock f;
4fast_block_lock f2;
5fast_cond_var( fast_block_lock ) f_c_f;
6
7thread T1 {};
8bool wait = true;
9bool wait2 = true;
10void main( T1 & this ) {
11    lock(f);
12    if (wait) {
13        wait = false;
14        wait(f_c_f, f);
15    } else {
16        notify_one(f_c_f);
17        unlock(f);
18    }
19    lock(f2);
20    if (wait2) {
21        wait2 = false;
22        wait(f_c_f, f2);
23    } else {
24        notify_one(f_c_f);
25        unlock(f2);
26    }
27}
28
29int main() {
30    T1 t[2];
31}
Note: See TracBrowser for help on using the repository browser.