Changes in src/tests/sched-int-barge.c [cd99ef1:9737ffe]
- File:
-
- 1 edited
-
src/tests/sched-int-barge.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/tests/sched-int-barge.c
rcd99ef1 r9737ffe 5 5 #include <thread> 6 6 7 static const unsigned long N = 50_000ul;8 9 #ifndef PREEMPTION_RATE10 #define PREEMPTION_RATE 10_000ul11 #endif12 13 unsigned int default_preemption() {14 return 0;15 }16 7 enum state_t { WAIT, SIGNAL, BARGE }; 17 8 … … 19 10 20 11 monitor global_data_t { 21 volatilebool done;12 bool done; 22 13 int counter; 23 14 state_t state; … … 60 51 c->do_wait2 = ((unsigned)rand48()) % (c->do_signal); 61 52 62 if(c->do_wait1 == c->do_wait2) sout | "Same" | endl;53 // if(c->do_wait1 == c->do_wait2) sout | "Same" | endl; 63 54 } 64 55 … … 82 73 } 83 74 84 if( c->counter >= N) c->done = true;75 if( c->counter >= 100_000 ) c->done = true; 85 76 return !c->done; 86 77 } … … 98 89 } 99 90 100 static thread_desc * volatile the_threads;101 102 91 int main(int argc, char* argv[]) { 103 rand48seed(0); 104 processor p; 105 { 106 Threads t[17]; 107 the_threads = (thread_desc*)t; 108 } 92 rand48seed(0); 93 processor p; 94 { 95 Threads t[17]; 96 } 109 97 }
Note:
See TracChangeset
for help on using the changeset viewer.