Changeset d6ff3ff for src/libcfa/concurrency/preemption.c
- Timestamp:
- Jul 13, 2017, 3:51:00 PM (6 years ago)
- Branches:
- aaron-thesis, arm-eh, 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:
- 0764cfb, 24fc196, 3d4b23fa
- Parents:
- 35b06a8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/preemption.c
r35b06a8 rd6ff3ff 180 180 181 181 static inline bool preemption_ready() { 182 return disable_preempt_count == 0 ;182 return disable_preempt_count == 0 && !preemption_in_progress; 183 183 } 184 184 … … 218 218 219 219 void kernel_stop_preemption() { 220 LIB_DEBUG_PRINT_SAFE("Kernel : Preemption stopping\n"); 221 220 222 sigset_t mask; 221 223 sigfillset( &mask ); … … 248 250 LIB_DEBUG_DO( last_interrupt = (void *)(cxt->uc_mcontext.gregs[CFA_REG_IP]); ) 249 251 if( preemption_ready() ) { 252 preemption_in_progress = true; 250 253 signal_unblock( SIGUSR1 ); 254 this_processor->pending_preemption = false; 255 preemption_in_progress = false; 251 256 BlockInternal( (thread_desc*)this_thread ); 252 257 } … … 255 260 } 256 261 } 257 258 // void sigHandler_alarm( __CFA_SIGPARMS__ ) {259 // LIB_DEBUG_DO( last_interrupt = (void *)(cxt->uc_mcontext.gregs[CFA_REG_IP]); )260 // verify( this_processor == systemProcessor );261 262 // if( try_lock( &systemProcessor->alarm_lock DEBUG_CTX2 ) ) {263 // tick_preemption();264 // systemProcessor->pending_alarm = false;265 // unlock( &systemProcessor->alarm_lock );266 // }267 // else {268 // defer_alarm();269 // }270 271 // signal_unblock( SIGALRM );272 273 // if( preemption_ready() && this_processor->pending_preemption ) {274 275 // this_processor->pending_preemption = false;276 // BlockInternal( (thread_desc*)this_thread );277 // }278 // }279 262 280 263 void * alarm_loop( __attribute__((unused)) void * args ) {
Note: See TracChangeset
for help on using the changeset viewer.