Ignore:
Timestamp:
Nov 8, 2017, 5:43:33 PM (8 years ago)
Author:
Aaron Moss <a3moss@…>
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:
954908d
Parents:
78315272 (diff), e35f30a (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 plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    r78315272 r3f7e12cb  
    2626volatile bool done;
    2727
    28 unsigned rand10() {
    29         return (unsigned)rand48() % 10;
    30 }
    31 
    3228//----------------------------------------------------------------------------------------------------
    3329// Acceptor
     
    3632void do_wait( global_t * mutex a ) {
    3733        sout | "Waiting to accept" | endl;
    38         yield( rand10() );
     34        yield( random( 10 ) );
    3935
    4036        sout | "Accepting" | endl;
     
    4541        acceptable.monitors      = &a;
    4642
    47         __accept_internal( 1, &acceptable );
     43        __waitfor_internal( 1, &acceptable );
    4844
    4945        sout | "Accepted" | endl;
    50         yield( rand10() );
     46        yield( random( 10 ) );
    5147}
    5248
     
    6864void main( Acceptee* this ) {
    6965        while( !done ) {
    70                 yield( rand10() );
     66                yield( random( 10 ) );
    7167                do_notify( &globalA );
    72                 yield( rand10() );
     68                yield( random( 10 ) );
    7369        }
    7470}
     
    7874int main(int argc, char* argv[]) {
    7975        done = false;
    80         rand48seed( time( NULL ) );
     76        random_seed( time( NULL ) );
    8177        printf("%p\n", &globalA);
    8278        sout | "Starting" | endl;
Note: See TracChangeset for help on using the changeset viewer.