Ignore:
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
    19#include <fstream>
    210#include <kernel>
     
    513#include <thread>
    614
     15static const unsigned long N = 50_000ul;
     16
     17#ifndef PREEMPTION_RATE
     18#define PREEMPTION_RATE 10_000ul
     19#endif
     20
     21unsigned int default_preemption() {
     22        return 0;
     23}
    724enum state_t { WAIT, SIGNAL, BARGE };
    825
     
    1027
    1128monitor global_data_t {
    12         bool done;
     29        volatile bool done;
    1330        int counter;
    1431        state_t state;
     
    5168                c.do_wait2 = ((unsigned)rand48()) % (c.do_signal);
    5269
    53                 // if(c.do_wait1 == c.do_wait2) sout | "Same" | endl;
     70                if(c.do_wait1 == c.do_wait2) sout | "Same" | endl;
    5471        }
    5572
     
    7390        }
    7491
    75         if( c.counter >= 100_000 ) c.done = true;
     92        if( c.counter >= N ) c.done = true;
    7693        return !c.done;
    7794}
     
    89106}
    90107
     108static thread_desc * volatile the_threads;
     109
    91110int main(int argc, char* argv[]) {
    92111        rand48seed(0);
     
    94113        {
    95114                Threads t[17];
     115                the_threads = (thread_desc*)t;
    96116        }
    97117}
Note: See TracChangeset for help on using the changeset viewer.