Ignore:
File:
1 edited

Legend:

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

    re3fea42 r09f357ec  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Feb  4 13:03:15 2020
    13 // Update Count     : 58
     12// Last Modified On : Thu Dec  5 16:25:52 2019
     13// Update Count     : 52
    1414//
    1515
     
    209209
    210210static void start(processor * this);
    211 void ?{}(processor & this, const char name[], cluster & cltr) with( this ) {
     211void ?{}(processor & this, const char * name, cluster & cltr) with( this ) {
    212212        this.name = name;
    213213        this.cltr = &cltr;
     
    238238}
    239239
    240 void ?{}(cluster & this, const char name[], Duration preemption_rate) with( this ) {
     240void ?{}(cluster & this, const char * name, Duration preemption_rate) with( this ) {
    241241        this.name = name;
    242242        this.preemption_rate = preemption_rate;
     
    441441}
    442442
    443 static void Abort( int ret, const char func[] ) {
     443static void Abort( int ret, const char * func ) {
    444444        if ( ret ) {                                                                            // pthread routines return errno values
    445445                abort( "%s : internal error, error(%d) %s.", func, ret, strerror( ret ) );
     
    469469        );
    470470
    471         Abort( pthread_attr_setstack( &attr, stack, stacksize ), "pthread_attr_setstack" ); 
     471        Abort( pthread_attr_setstack( &attr, stack, stacksize ), "pthread_attr_setstack" );
    472472
    473473        Abort( pthread_create( pthread, &attr, start, arg ), "pthread_create" );
     
    490490        verify( ! kernelTLS.preemption_state.enabled );
    491491
     492        kernelTLS.this_thread->curr_cor = dst;
    492493        __stack_prepare( &dst->stack, 65000 );
    493         CtxStart(&this->runner, CtxInvokeCoroutine);
     494        CtxStart(main, dst, this->runner, CtxInvokeCoroutine);
    494495
    495496        verify( ! kernelTLS.preemption_state.enabled );
     
    505506        CtxSwitch( &src->context, &dst->context );
    506507        // when CtxSwitch returns we are back in the src coroutine
     508
     509        mainThread->curr_cor = &mainThread->self_cor;
    507510
    508511        // set state of new coroutine to active
     
    841844                sigemptyset( &mask );
    842845                sigaddset( &mask, SIGALRM );            // block SIGALRM signals
    843                 sigaddset( &mask, SIGUSR1 );            // block SIGALRM signals
    844                 sigsuspend( &mask );                            // block the processor to prevent further damage during abort
    845                 _exit( EXIT_FAILURE );                          // if processor unblocks before it is killed, terminate it
     846                sigsuspend( &mask );                    // block the processor to prevent further damage during abort
     847                _exit( EXIT_FAILURE );                  // if processor unblocks before it is killed, terminate it
    846848        }
    847849        else {
     
    978980__cfaabi_dbg_debug_do(
    979981        extern "C" {
    980                 void __cfaabi_dbg_record(__spinlock_t & this, const char prev_name[]) {
     982                void __cfaabi_dbg_record(__spinlock_t & this, const char * prev_name) {
    981983                        this.prev_name = prev_name;
    982984                        this.prev_thrd = kernelTLS.this_thread;
Note: See TracChangeset for help on using the changeset viewer.