Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/sched-int-barge.c

    rcd99ef1 r9737ffe  
    55#include <thread>
    66
    7 static const unsigned long N = 50_000ul;
    8 
    9 #ifndef PREEMPTION_RATE
    10 #define PREEMPTION_RATE 10_000ul
    11 #endif
    12 
    13 unsigned int default_preemption() {
    14         return 0;
    15 }
    167enum state_t { WAIT, SIGNAL, BARGE };
    178
     
    1910
    2011monitor global_data_t {
    21         volatile bool done;
     12        bool done;
    2213        int counter;
    2314        state_t state;
     
    6051                c->do_wait2 = ((unsigned)rand48()) % (c->do_signal);
    6152
    62                 if(c->do_wait1 == c->do_wait2) sout | "Same" | endl;
     53                // if(c->do_wait1 == c->do_wait2) sout | "Same" | endl;
    6354        }
    6455
     
    8273        }
    8374
    84         if( c->counter >= N ) c->done = true;
     75        if( c->counter >= 100_000 ) c->done = true;
    8576        return !c->done;
    8677}
     
    9889}
    9990
    100 static thread_desc * volatile the_threads;
    101 
    10291int 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        }
    10997}
Note: See TracChangeset for help on using the changeset viewer.