- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/concurrent/signal/disjoint.c
rb9da9585 ref952d7 4 4 #include <thread> 5 5 #include <time> 6 7 #include "long_tests.h" 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 … … 26 28 monitor global_data_t; 27 29 void ?{}( global_data_t & this ); 28 void ^?{} ( global_data_t & this );30 void ^?{} ( global_data_t & mutex this ); 29 31 30 32 monitor global_data_t { … … 42 44 } 43 45 44 void ^?{} ( global_data_t & this ) {}46 void ^?{} ( global_data_t & mutex this ) {} 45 47 46 48 //------------------------------------------------------------------------------ … … 67 69 } 68 70 69 d.counter++; 71 #if !defined(TEST_FOREVER) 72 d.counter++; 73 if( (d.counter % 1000) == 0 ) sout | d.counter | endl; 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 101 sout | "ERROR Eager signal" | data.state | endl;
Note:
See TracChangeset
for help on using the changeset viewer.