Ignore:
Timestamp:
Jul 20, 2017, 11:33:59 PM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
6d54c3a
Parents:
dab7ac7 (diff), e1e4aa9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg2:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    rdab7ac7 r21a5dde1  
    55#include <thread>
    66
    7 #ifndef N
    8 #define N 100_000
     7static const unsigned long N = 50_000ul;
     8
     9#ifndef PREEMPTION_RATE
     10#define PREEMPTION_RATE 10_000ul
    911#endif
    1012
     13unsigned int default_preemption() {
     14        return 0;
     15}
    1116enum state_t { WAIT, SIGNAL, BARGE };
    1217
     
    1419
    1520monitor global_data_t {
    16         bool done;
     21        volatile bool done;
    1722        int counter;
    1823        state_t state;
     
    5560                c->do_wait2 = ((unsigned)rand48()) % (c->do_signal);
    5661
    57                 // if(c->do_wait1 == c->do_wait2) sout | "Same" | endl;
     62                if(c->do_wait1 == c->do_wait2) sout | "Same" | endl;
    5863        }
    5964
     
    9398}
    9499
     100static thread_desc * volatile the_threads;
     101
    95102int main(int argc, char* argv[]) {
    96         rand48seed(0);
    97         processor p;
    98         {
    99                 Threads t[17];
    100         }
     103        rand48seed(0);
     104        processor p;
     105        {
     106                Threads t[17];
     107                the_threads = (thread_desc*)t;
     108        }
    101109}
Note: See TracChangeset for help on using the changeset viewer.