Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrent/sleep.cfa

    r7bd23ce rc457dc41  
    77}
    88
    9 volatile int counter = 0;
    10 
    119thread fast_sleeper {};
    1210void main(fast_sleeper &) {
     
    1412        for(i; 20) {
    1513                sleep(wait);
    16                 __atomic_fetch_add( &counter, 1, __ATOMIC_RELAXED );
     14                sout | acquire | "fast loop" | ((1 + i) * wait);
    1715        }
    1816}
     
    2220        Duration wait = 277`ms;
    2321        for(i; 4) {
     22
    2423                sleep(wait);
    25                 int val = __atomic_add_fetch( &counter, -5, __ATOMIC_RELAXED );
    26                 if(val < -9) abort | "Value reached negative value:" | val;
     24                sout | acquire | "slow loop" | ((1 + i) * wait);
    2725        }
    2826}
Note: See TracChangeset for help on using the changeset viewer.