Changeset b067d9b for tests/concurrent/signal/disjoint.cfa
- Timestamp:
- Oct 29, 2019, 4:01:24 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 773db65, 9421f3d8
- Parents:
- 7951100 (diff), 8364209 (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. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/signal/disjoint.cfa
r7951100 rb067d9b 1 #include <fstream> 2 #include <kernel> 3 #include <monitor> 4 #include <thread> 5 #include <time> 1 #include <fstream.hfa> 2 #include <kernel.hfa> 3 #include <monitor.hfa> 4 #include <thread.hfa> 5 #include <time.hfa> 6 7 #include "long_tests.hfa" 6 8 7 9 #ifndef PREEMPTION_RATE … … 13 15 } 14 16 15 #ifdef LONG_TEST17 #ifdef TEST_LONG 16 18 static const unsigned long N = 300_000ul; 17 19 #else … … 64 66 wait( cond ); 65 67 if( d.state != SIGNAL ) { 66 sout | "ERROR barging!" | endl;68 sout | "ERROR barging!"; 67 69 } 68 70 69 d.counter++; 71 #if !defined(TEST_FOREVER) 72 d.counter++; 73 if( (d.counter % 1000) == 0 ) sout | d.counter; 74 #endif 70 75 71 if( (d.counter % 1000) == 0 ) sout | d.counter | endl; 72 73 return d.counter < N; 76 return TEST(d.counter < N); 74 77 } 75 78 … … 77 80 78 81 void main( Waiter & this ) { 79 while( wait( mut, data ) ) { yield(); }82 while( wait( mut, data ) ) { KICK_WATCHDOG; yield(); } 80 83 } 81 84 … … 94 97 95 98 //This is technically a mutual exclusion violation but the mutex monitor protects us 96 bool running = data.counter < N&& data.counter > 0;99 bool running = TEST(data.counter < N) && data.counter > 0; 97 100 if( data.state != SIGNAL && running ) { 98 sout | "ERROR Eager signal" | data.state | endl;101 sout | "ERROR Eager signal" | data.state; 99 102 } 100 103 } … … 121 124 Waiter w[4]; 122 125 } 123 sout | "All waiter done" | endl;126 sout | "All waiter done"; 124 127 all_done = true; 125 128 }
Note:
See TracChangeset
for help on using the changeset viewer.