Ignore:
File:
1 edited

Legend:

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

    r09f357ec re3fea42  
    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
     
    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;
    493492        __stack_prepare( &dst->stack, 65000 );
    494         CtxStart(main, dst, this->runner, CtxInvokeCoroutine);
     493        CtxStart(&this->runner, CtxInvokeCoroutine);
    495494
    496495        verify( ! kernelTLS.preemption_state.enabled );
     
    506505        CtxSwitch( &src->context, &dst->context );
    507506        // when CtxSwitch returns we are back in the src coroutine
    508 
    509         mainThread->curr_cor = &mainThread->self_cor;
    510507
    511508        // set state of new coroutine to active
     
    844841                sigemptyset( &mask );
    845842                sigaddset( &mask, SIGALRM );            // block SIGALRM signals
    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
     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
    848846        }
    849847        else {
     
    980978__cfaabi_dbg_debug_do(
    981979        extern "C" {
    982                 void __cfaabi_dbg_record(__spinlock_t & this, const char * prev_name) {
     980                void __cfaabi_dbg_record(__spinlock_t & this, const char prev_name[]) {
    983981                        this.prev_name = prev_name;
    984982                        this.prev_thrd = kernelTLS.this_thread;
Note: See TracChangeset for help on using the changeset viewer.