Ignore:
Timestamp:
Oct 31, 2017, 11:17:46 AM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
0dc954b, 4cedd9f
Parents:
5434d04
Message:

Updated concurrency tests with bounded rand48

File:
1 edited

Legend:

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

    r5434d04 re1e8408  
    4242void main( barger_t & this ) {
    4343        yield();
    44         while( barge( global ) ) { yield(((unsigned)rand48()) % 10); }
     44        while( barge( global ) ) { yield( rand48(10) ); }
    4545}
    4646
    4747bool do_call( global_t & mutex this ) {
    48         yield(((unsigned)rand48()) % 10);
     48        yield(rand48(10));
    4949        if( this.state != WAITFOR && !this.done && this.started ) {
    5050                serr | "Barging before caller detected" | endl;
     
    5757thread caller_t {};
    5858void main( caller_t & this ) {
    59         while( do_call(global) ) { yield(((unsigned)rand48()) % 10); }
     59        while( do_call(global) ) { yield(rand48(10)); }
    6060}
    6161
     
    6363        this.started = true;
    6464        for( int i = 0; i < N; i++) {
    65                 yield(((unsigned)rand48()) % 10);
     65                yield(rand48(10));
    6666                this.state = WAITFOR;
    6767                waitfor(do_call, this) {
Note: See TracChangeset for help on using the changeset viewer.