Ignore:
File:
1 edited

Legend:

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

    rd67cdb7 r6c7b1e7  
    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;
     
    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.