Ignore:
File:
1 edited

Legend:

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

    r6c7b1e7 rd67cdb7  
    2626volatile bool done;
    2727
     28unsigned rand10() {
     29        return (unsigned)rand48() % 10;
     30}
     31
    2832//----------------------------------------------------------------------------------------------------
    2933// Acceptor
     
    3236void do_wait( global_t * mutex a ) {
    3337        sout | "Waiting to accept" | endl;
    34         yield( random( 10 ) );
     38        yield( rand10() );
    3539
    3640        sout | "Accepting" | endl;
     
    4448
    4549        sout | "Accepted" | endl;
    46         yield( random( 10 ) );
     50        yield( rand10() );
    4751}
    4852
     
    6468void main( Acceptee* this ) {
    6569        while( !done ) {
    66                 yield( random( 10 ) );
     70                yield( rand10() );
    6771                do_notify( &globalA );
    68                 yield( random( 10 ) );
     72                yield( rand10() );
    6973        }
    7074}
     
    7478int main(int argc, char* argv[]) {
    7579        done = false;
    76         random_seed( time( NULL ) );
     80        rand48seed( time( NULL ) );
    7781        printf("%p\n", &globalA);
    7882        sout | "Starting" | endl;
Note: See TracChangeset for help on using the changeset viewer.