Ignore:
Timestamp:
Feb 20, 2020, 4:15:51 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
6a490b2
Parents:
dca5802 (diff), 2cbfe92 (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' into relaxed_ready

File:
1 edited

Legend:

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

    rdca5802 rb7d6a36  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Dec  5 16:25:52 2019
    13 // Update Count     : 52
     12// Last Modified On : Tue Feb  4 13:03:15 2020
     13// Update Count     : 58
    1414//
    1515
     
    210210
    211211static void start(processor * this);
    212 void ?{}(processor & this, const char * name, cluster & cltr) with( this ) {
     212void ?{}(processor & this, const char name[], cluster & cltr) with( this ) {
    213213        this.name = name;
    214214        this.cltr = &cltr;
     
    240240}
    241241
    242 void ?{}(cluster & this, const char * name, Duration preemption_rate) with( this ) {
     242void ?{}(cluster & this, const char name[], Duration preemption_rate) with( this ) {
    243243        this.name = name;
    244244        this.preemption_rate = preemption_rate;
     
    454454}
    455455
    456 static void Abort( int ret, const char * func ) {
     456static void Abort( int ret, const char func[] ) {
    457457        if ( ret ) {                                                                            // pthread routines return errno values
    458458                abort( "%s : internal error, error(%d) %s.", func, ret, strerror( ret ) );
     
    503503        verify( ! kernelTLS.preemption_state.enabled );
    504504
     505        kernelTLS.this_thread->curr_cor = dst;
    505506        __stack_prepare( &dst->stack, 65000 );
    506         CtxStart(&this->runner, CtxInvokeCoroutine);
     507        CtxStart(main, dst, this->runner, CtxInvokeCoroutine);
    507508
    508509        verify( ! kernelTLS.preemption_state.enabled );
     
    518519        CtxSwitch( &src->context, &dst->context );
    519520        // when CtxSwitch returns we are back in the src coroutine
     521
     522        mainThread->curr_cor = &mainThread->self_cor;
    520523
    521524        // set state of new coroutine to active
     
    864867                sigemptyset( &mask );
    865868                sigaddset( &mask, SIGALRM );            // block SIGALRM signals
    866                 sigsuspend( &mask );                    // block the processor to prevent further damage during abort
    867                 _exit( EXIT_FAILURE );                  // if processor unblocks before it is killed, terminate it
     869                sigaddset( &mask, SIGUSR1 );            // block SIGALRM signals
     870                sigsuspend( &mask );                            // block the processor to prevent further damage during abort
     871                _exit( EXIT_FAILURE );                          // if processor unblocks before it is killed, terminate it
    868872        }
    869873        else {
     
    986990__cfaabi_dbg_debug_do(
    987991        extern "C" {
    988                 void __cfaabi_dbg_record(__spinlock_t & this, const char * prev_name) {
     992                void __cfaabi_dbg_record(__spinlock_t & this, const char prev_name[]) {
    989993                        this.prev_name = prev_name;
    990994                        this.prev_thrd = kernelTLS.this_thread;
Note: See TracChangeset for help on using the changeset viewer.