Changes in src/tests/sched-int-barge.c [83a071f9:9fe39530]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/sched-int-barge.c
r83a071f9 r9fe39530 1 //---------------------------------------------------------------------------------------- 2 //---------------------------------------------------------------------------------------- 3 // 4 // DEPRECATED TEST 5 // 6 //---------------------------------------------------------------------------------------- 7 //---------------------------------------------------------------------------------------- 8 1 9 #include <fstream> 2 10 #include <kernel> … … 5 13 #include <thread> 6 14 15 static const unsigned long N = 50_000ul; 16 17 #ifndef PREEMPTION_RATE 18 #define PREEMPTION_RATE 10_000ul 19 #endif 20 21 unsigned int default_preemption() { 22 return 0; 23 } 7 24 enum state_t { WAIT, SIGNAL, BARGE }; 8 25 … … 10 27 11 28 monitor global_data_t { 12 bool done;29 volatile bool done; 13 30 int counter; 14 31 state_t state; … … 51 68 c.do_wait2 = ((unsigned)rand48()) % (c.do_signal); 52 69 53 //if(c.do_wait1 == c.do_wait2) sout | "Same" | endl;70 if(c.do_wait1 == c.do_wait2) sout | "Same" | endl; 54 71 } 55 72 … … 73 90 } 74 91 75 if( c.counter >= 100_000) c.done = true;92 if( c.counter >= N ) c.done = true; 76 93 return !c.done; 77 94 } … … 89 106 } 90 107 108 static thread_desc * volatile the_threads; 109 91 110 int main(int argc, char* argv[]) { 92 111 rand48seed(0); … … 94 113 { 95 114 Threads t[17]; 115 the_threads = (thread_desc*)t; 96 116 } 97 117 }
Note: See TracChangeset
for help on using the changeset viewer.