- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/concurrent/signal/block.c
r70969f8 r0f56058 12 12 #include <stdlib> 13 13 #include <thread> 14 15 #include <time.h> 14 #include <time> 16 15 17 16 #ifdef LONG_TEST … … 22 21 23 22 #ifndef PREEMPTION_RATE 24 #define PREEMPTION_RATE 10 _000ul23 #define PREEMPTION_RATE 10`ms 25 24 #endif 26 25 27 unsigned intdefault_preemption() {26 Duration default_preemption() { 28 27 return PREEMPTION_RATE; 29 28 } … … 51 50 //------------------------------------------------------------------------------ 52 51 void wait_op( global_data_t & mutex a, global_data_t & mutex b, unsigned i ) { 53 wait( cond, (uintptr_t)this_thread);52 wait( cond, (uintptr_t)active_thread() ); 54 53 55 54 yield( random( 10 ) ); … … 60 59 } 61 60 62 a.last_thread = b.last_thread = this_thread;61 a.last_thread = b.last_thread = active_thread(); 63 62 64 63 yield( random( 10 ) ); … … 76 75 yield( random( 10 ) ); 77 76 78 [a.last_thread, b.last_thread, a.last_signaller, b.last_signaller] = this_thread;77 [a.last_thread, b.last_thread, a.last_signaller, b.last_signaller] = active_thread(); 79 78 80 79 if( !is_empty( cond ) ) { … … 106 105 //------------------------------------------------------------------------------ 107 106 void barge_op( global_data_t & mutex a ) { 108 a.last_thread = this_thread;107 a.last_thread = active_thread(); 109 108 } 110 109
Note:
See TracChangeset
for help on using the changeset viewer.