Changeset fd3be42 for tests/concurrency/waituntil
- Timestamp:
- Mar 19, 2025, 4:54:09 PM (6 months ago)
- Branches:
- master
- Children:
- 5329cba
- Parents:
- 42cd67b8 (diff), e1358c0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- tests/concurrency/waituntil
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrency/waituntil/all_types.cfa
r42cd67b8 rfd3be42 39 39 or when( i % 4 < 2 ) waituntil( B ) { consume_b_val( myTotal ); } 40 40 or waituntil( c << C ) { if ( c == -1 ) break; myTotal += c; } 41 or when( i % 3 ) waituntil( timeout( 1`ms ) ) {}41 or when( i % 3 ) waituntil( _timeout( 1`ms ) ) {} 42 42 or when( i % 8 < 4 ) else {} 43 43 } … … 53 53 or waituntil( c << C ) { if ( c == -1 ) break; myTotal += c; } 54 54 or waituntil( B ) { consume_b_val( myTotal ); } 55 or waituntil( timeout( 100`ns ) ) { }55 or waituntil( _timeout( 100`ns ) ) { } 56 56 } 57 57 __atomic_fetch_add( &globalTotal, myTotal, __ATOMIC_SEQ_CST ); … … 99 99 or when( j % 4 < 2 ) waituntil( B ) { produce_b_val( total ); } 100 100 and when( j % 8 < 4 ) waituntil( C << j ) { total += j; } 101 and waituntil( timeout( 1`ns ) ) {}101 and waituntil( _timeout( 1`ns ) ) {} 102 102 if ( j == numtimes / 2 ) 103 103 fulfil( F, val_to_deliver ); -
tests/concurrency/waituntil/timeout.cfa
r42cd67b8 rfd3be42 6 6 7 7 int main() { 8 waituntil( sleep( 1`ms ) ) { printf("timeout\n"); }9 waituntil( timeout( 1`s ) ) { printf("timeout\n"); } or waituntil(timeout( 2`s ) ) { printf("timeout\n"); }10 waituntil( timeout( 100`s ) ) { printf("timeout 1\n"); } or else { printf("else\n"); }11 waituntil( timeout( 1`ns ) ) { printf("timeout\n"); } and waituntil(timeout( 2`s ) ) { printf("timeout\n"); }8 waituntil( _timeout( 1`ms ) ) { printf("timeout\n"); } 9 waituntil( _timeout( 1`s ) ) { printf("timeout\n"); } or waituntil( _timeout( 2`s ) ) { printf("timeout\n"); } 10 waituntil( _timeout( 100`s ) ) { printf("timeout 1\n"); } or else { printf("else\n"); } 11 waituntil( _timeout( 1`ns ) ) { printf("timeout\n"); } and waituntil( _timeout( 2`s ) ) { printf("timeout\n"); } 12 12 int count = 0; 13 13 for ( i; 1000 ) 14 waituntil( timeout( 1`ns ) ) { count++; } or else { count++; }14 waituntil( _timeout( 1`ns ) ) { count++; } or else { count++; } 15 15 16 16 assert( count == 1000 ); 17 sleep( 1`ms );17 _timeout( 1`ms ); 18 18 printf("done\n"); 19 19 }
Note:
See TracChangeset
for help on using the changeset viewer.