Ignore:
Timestamp:
Jun 7, 2018, 1:29:41 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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.
Message:

Merge branch 'master' of plg2:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/preemption.c

    r8551b859 r95487027  
    265265// kill wrapper : signal a processor
    266266void 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 );
    269270        sigval_t value = { PREEMPT_TERMINATE };
     271        enable_interrupts( __cfaabi_dbg_ctx );
    270272        pthread_sigqueue( this->kernel_thread, SIGUSR1, value );
    271273}
     
    369371        choose(sfp->si_value.sival_int) {
    370372                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 ) );
    372374                default:
    373375                        abort( "internal error, signal value is %d", sfp->si_value.sival_int );
     
    488490}
    489491
     492#ifdef __CFA_WITH_VERIFY__
     493bool __cfaabi_dbg_in_kernel() {
     494        return !kernelTLS.preemption_state.enabled;
     495}
     496#endif
     497
    490498// Local Variables: //
    491499// mode: c //
Note: See TracChangeset for help on using the changeset viewer.