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