- Timestamp:
- Oct 1, 2020, 1:52:53 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- b4b63e8
- Parents:
- 038110a
- Location:
- tests/concurrent/park
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/park/contention.cfa
r038110a re235429 21 21 if(blocked[idx]) { 22 22 Thread * thrd = __atomic_exchange_n(&blocked[idx], 0p, __ATOMIC_SEQ_CST); 23 unpark( *thrd __cfaabi_dbg_ctx2);23 unpark( *thrd ); 24 24 } else { 25 25 Thread * thrd = __atomic_exchange_n(&blocked[idx], &this, __ATOMIC_SEQ_CST); 26 unpark( *thrd __cfaabi_dbg_ctx2);27 park( __cfaabi_dbg_ctx);26 unpark( *thrd ); 27 park(); 28 28 } 29 29 } … … 41 41 int idx = myrand() % blocked_size; 42 42 Thread * thrd = __atomic_exchange_n(&blocked[idx], 0p, __ATOMIC_SEQ_CST); 43 unpark( *thrd __cfaabi_dbg_ctx2);43 unpark( *thrd ); 44 44 yield( myrand() % 20 ); 45 45 } -
tests/concurrent/park/force_preempt.cfa
r038110a re235429 30 30 31 31 // Unpark this thread, don't force a yield 32 unpark( this __cfaabi_dbg_ctx2);32 unpark( this ); 33 33 assert(mask == 0xCAFEBABA); 34 34 … … 43 43 // Park this thread, 44 44 assert(mask == (id_hash ^ 0xCAFEBABA)); 45 park( __cfaabi_dbg_ctx);45 park(); 46 46 assert(mask == (id_hash ^ 0xCAFEBABA)); 47 47 -
tests/concurrent/park/start_parked.cfa
r038110a re235429 3 3 thread Parker {}; 4 4 void main( Parker & ) { 5 park( __cfaabi_dbg_ctx);5 park(); 6 6 } 7 7 … … 9 9 for(1000) { 10 10 Parker parker; 11 unpark( parker __cfaabi_dbg_ctx2);11 unpark( parker ); 12 12 } 13 13 printf( "done\n" ); // non-empty .expect file
Note: See TracChangeset
for help on using the changeset viewer.