- File:
-
- 1 edited
-
src/tests/concurrent/signal/disjoint.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/tests/concurrent/signal/disjoint.c
ref952d7 rb9da9585 4 4 #include <thread> 5 5 #include <time> 6 7 #include "long_tests.h"8 6 9 7 #ifndef PREEMPTION_RATE … … 15 13 } 16 14 17 #ifdef TEST_LONG15 #ifdef LONG_TEST 18 16 static const unsigned long N = 300_000ul; 19 17 #else … … 28 26 monitor global_data_t; 29 27 void ?{}( global_data_t & this ); 30 void ^?{} ( global_data_t & mutexthis );28 void ^?{} ( global_data_t & this ); 31 29 32 30 monitor global_data_t { … … 44 42 } 45 43 46 void ^?{} ( global_data_t & mutexthis ) {}44 void ^?{} ( global_data_t & this ) {} 47 45 48 46 //------------------------------------------------------------------------------ … … 69 67 } 70 68 71 #if !defined(TEST_FOREVER) 72 d.counter++; 73 if( (d.counter % 1000) == 0 ) sout | d.counter | endl; 74 #endif 69 d.counter++; 75 70 76 return TEST(d.counter < N); 71 if( (d.counter % 1000) == 0 ) sout | d.counter | endl; 72 73 return d.counter < N; 77 74 } 78 75 … … 80 77 81 78 void main( Waiter & this ) { 82 while( wait( mut, data ) ) { KICK_WATCHDOG;yield(); }79 while( wait( mut, data ) ) { yield(); } 83 80 } 84 81 … … 97 94 98 95 //This is technically a mutual exclusion violation but the mutex monitor protects us 99 bool running = TEST(data.counter < N)&& data.counter > 0;96 bool running = data.counter < N && data.counter > 0; 100 97 if( data.state != SIGNAL && running ) { 101 98 sout | "ERROR Eager signal" | data.state | endl;
Note:
See TracChangeset
for help on using the changeset viewer.