Ignore:
Timestamp:
Jan 10, 2022, 4:14:23 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
4177592f, 770d9ab
Parents:
04a8a54 (diff), 56d711f (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 plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel/startup.cfa

    r04a8a54 rcc56283  
    279279        // When its coroutine terminates, it return control to the mainThread
    280280        // which is currently here
     281        /* paranoid */ verify( !__atomic_load_n(&mainProcessor->do_terminate, __ATOMIC_ACQUIRE) );
    281282        __atomic_store_n(&mainProcessor->do_terminate, true, __ATOMIC_RELEASE);
     283        __wake_proc( mainProcessor );
    282284        __kernel_last_resume( __cfaabi_tls.this_processor );
    283285        mainThread->self_cor.state = Halted;
     
    564566extern size_t __page_size;
    565567void ^?{}(processor & this) with( this ){
    566         if( ! __atomic_load_n(&do_terminate, __ATOMIC_ACQUIRE) ) {
    567                 __cfadbg_print_safe(runtime_core, "Kernel : core %p signaling termination\n", &this);
    568 
    569                 __atomic_store_n(&do_terminate, true, __ATOMIC_RELAXED);
     568        /* paranoid */ verify( !__atomic_load_n(&do_terminate, __ATOMIC_ACQUIRE) );
     569        __cfadbg_print_safe(runtime_core, "Kernel : core %p signaling termination\n", &this);
     570
     571        __atomic_store_n(&do_terminate, true, __ATOMIC_RELAXED);
     572        __disable_interrupts_checked();
    570573                __wake_proc( &this );
    571 
    572                 wait( terminated );
    573                 /* paranoid */ verify( active_processor() != &this);
    574         }
     574        __enable_interrupts_checked();
     575
     576        wait( terminated );
     577        /* paranoid */ verify( active_processor() != &this);
    575578
    576579        __destroy_pthread( kernel_thread, this.stack, 0p );
Note: See TracChangeset for help on using the changeset viewer.