Changeset e1e8408 for src/tests/sched-ext-barge.c
- Timestamp:
- Oct 31, 2017, 11:17:46 AM (7 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/sched-ext-barge.c
r5434d04 re1e8408 42 42 void main( barger_t & this ) { 43 43 yield(); 44 while( barge( global ) ) { yield( ((unsigned)rand48()) % 10); }44 while( barge( global ) ) { yield( rand48(10) ); } 45 45 } 46 46 47 47 bool do_call( global_t & mutex this ) { 48 yield( ((unsigned)rand48()) % 10);48 yield(rand48(10)); 49 49 if( this.state != WAITFOR && !this.done && this.started ) { 50 50 serr | "Barging before caller detected" | endl; … … 57 57 thread caller_t {}; 58 58 void main( caller_t & this ) { 59 while( do_call(global) ) { yield( ((unsigned)rand48()) % 10); }59 while( do_call(global) ) { yield(rand48(10)); } 60 60 } 61 61 … … 63 63 this.started = true; 64 64 for( int i = 0; i < N; i++) { 65 yield( ((unsigned)rand48()) % 10);65 yield(rand48(10)); 66 66 this.state = WAITFOR; 67 67 waitfor(do_call, this) {
Note: See TracChangeset
for help on using the changeset viewer.