Changeset 95487027 for src/libcfa/concurrency/preemption.c
- Timestamp:
- Jun 7, 2018, 1:29:41 PM (6 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, with_gc
- Children:
- 08b5a7e
- Parents:
- 8551b859 (diff), a43c561 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/preemption.c
r8551b859 r95487027 265 265 // kill wrapper : signal a processor 266 266 void terminate(processor * this) { 267 this->do_terminate = true; 268 wake(this); 267 disable_interrupts(); 268 __atomic_store_n(&this->do_terminate, true, __ATOMIC_SEQ_CST); 269 wake( this ); 269 270 sigval_t value = { PREEMPT_TERMINATE }; 271 enable_interrupts( __cfaabi_dbg_ctx ); 270 272 pthread_sigqueue( this->kernel_thread, SIGUSR1, value ); 271 273 } … … 369 371 choose(sfp->si_value.sival_int) { 370 372 case PREEMPT_NORMAL : ;// Normal case, nothing to do here 371 case PREEMPT_TERMINATE: verify( kernelTLS.this_processor->do_terminate);373 case PREEMPT_TERMINATE: verify( __atomic_load_n( &kernelTLS.this_processor->do_terminate, __ATOMIC_SEQ_CST ) ); 372 374 default: 373 375 abort( "internal error, signal value is %d", sfp->si_value.sival_int ); … … 488 490 } 489 491 492 #ifdef __CFA_WITH_VERIFY__ 493 bool __cfaabi_dbg_in_kernel() { 494 return !kernelTLS.preemption_state.enabled; 495 } 496 #endif 497 490 498 // Local Variables: // 491 499 // mode: c //
Note: See TracChangeset
for help on using the changeset viewer.