Ignore:
File:
1 edited

Legend:

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

    rafd550c rde6319f  
    8181        disable_interrupts();
    8282        create_stack(&thrd_c->stack, thrd_c->stack.size);
    83         kernelTLS.this_coroutine = thrd_c;
     83        TL_SET( this_coroutine, thrd_c );
    8484        CtxStart(&this, CtxInvokeThread);
    8585        assert( thrd_c->last->stack.context );
     
    9191
    9292extern "C" {
    93         // KERNEL ONLY
    9493        void __finish_creation(void) {
    95                 coroutine_desc* thrd_c = kernelTLS.this_coroutine;
     94                coroutine_desc* thrd_c = TL_GET( this_coroutine );
    9695                ThreadCtxSwitch( thrd_c, thrd_c->last );
    9796        }
     
    9998
    10099void yield( void ) {
    101         // Safety note : This could cause some false positives due to preemption
    102       verify( TL_GET( preemption_state.enabled ) );
     100        verify( TL_GET( preemption_state ).enabled );
    103101        BlockInternal( TL_GET( this_thread ) );
    104         // Safety note : This could cause some false positives due to preemption
    105       verify( TL_GET( preemption_state.enabled ) );
     102        verify( TL_GET( preemption_state ).enabled );
    106103}
    107104
     
    112109}
    113110
    114 // KERNEL ONLY
    115111void ThreadCtxSwitch(coroutine_desc* src, coroutine_desc* dst) {
    116112        // set state of current coroutine to inactive
     
    120116        // set new coroutine that the processor is executing
    121117        // and context switch to it
    122         kernelTLS.this_coroutine = dst;
     118        TL_SET( this_coroutine, dst );
    123119        assert( src->stack.context );
    124120        CtxSwitch( src->stack.context, dst->stack.context );
    125         kernelTLS.this_coroutine = src;
     121        TL_SET( this_coroutine, src );
    126122
    127123        // set state of new coroutine to active
Note: See TracChangeset for help on using the changeset viewer.