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

Last change on this file since 0766399 was 50be8af, checked in by Peter A. Buhr <pabuhr@…>, 14 months ago

clean up command-line handling and I/O

  • Property mode set to 100644
File size: 494 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.