Ignore:
Timestamp:
Aug 14, 2017, 2:03:39 PM (5 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, 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, resolv-new, with_gc
Children:
74b007ba
Parents:
fd344aa (diff), 54cd58b (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' into references

File:
1 edited

Legend:

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

    rfd344aa r9236060  
    55#include <thread>
    66
     7static const unsigned long N = 50_000ul;
     8
     9#ifndef PREEMPTION_RATE
     10#define PREEMPTION_RATE 10_000ul
     11#endif
     12
     13unsigned int default_preemption() {
     14        return 0;
     15}
    716enum state_t { WAIT, SIGNAL, BARGE };
    817
     
    1019
    1120monitor global_data_t {
    12         bool done;
     21        volatile bool done;
    1322        int counter;
    1423        state_t state;
     
    5160                c.do_wait2 = ((unsigned)rand48()) % (c.do_signal);
    5261
    53                 // if(c.do_wait1 == c.do_wait2) sout | "Same" | endl;
     62                if(c.do_wait1 == c.do_wait2) sout | "Same" | endl;
    5463        }
    5564
     
    7382        }
    7483
    75         if( c.counter >= 100_000 ) c.done = true;
     84        if( c.counter >= N ) c.done = true;
    7685        return !c.done;
    7786}
     
    8998}
    9099
     100static thread_desc * volatile the_threads;
     101
    91102int main(int argc, char* argv[]) {
    92103        rand48seed(0);
     
    94105        {
    95106                Threads t[17];
     107                the_threads = (thread_desc*)t;
    96108        }
    97109}
Note: See TracChangeset for help on using the changeset viewer.