Ignore:
Timestamp:
Apr 25, 2018, 4:55:53 PM (8 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
42107b4
Parents:
2efe4b8 (diff), 9d5fb67 (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 remote-tracking branch 'origin/master' into with_gc

File:
1 edited

Legend:

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

    r2efe4b8 r1cdfa82  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 21 22:34:46 2017
    13 // Update Count     : 1
     12// Last Modified On : Fri Mar 30 17:19:52 2018
     13// Update Count     : 8
    1414//
    1515
     
    2626}
    2727
    28 extern volatile thread_local processor * this_processor;
     28//extern volatile thread_local processor * this_processor;
    2929
    3030//-----------------------------------------------------------------------------
     
    7575        coroutine_desc* thrd_c = get_coroutine(this);
    7676        thread_desc   * thrd_h = get_thread   (this);
    77         thrd_c->last = this_coroutine;
     77        thrd_c->last = TL_GET( this_coroutine );
    7878
    7979        // __cfaabi_dbg_print_safe("Thread start : %p (t %p, c %p)\n", this, thrd_c, thrd_h);
     
    8181        disable_interrupts();
    8282        create_stack(&thrd_c->stack, thrd_c->stack.size);
    83         this_coroutine = thrd_c;
     83        TL_SET( this_coroutine, thrd_c );
    8484        CtxStart(&this, CtxInvokeThread);
    8585        assert( thrd_c->last->stack.context );
     
    9292extern "C" {
    9393        void __finish_creation(void) {
    94                 coroutine_desc* thrd_c = this_coroutine;
     94                coroutine_desc* thrd_c = TL_GET( this_coroutine );
    9595                ThreadCtxSwitch( thrd_c, thrd_c->last );
    9696        }
     
    9898
    9999void yield( void ) {
    100         verify( preemption_state.enabled );
    101         BlockInternal( this_thread );
    102         verify( preemption_state.enabled );
     100        verify( TL_GET( preemption_state ).enabled );
     101        BlockInternal( TL_GET( this_thread ) );
     102        verify( TL_GET( preemption_state ).enabled );
    103103}
    104104
     
    116116        // set new coroutine that the processor is executing
    117117        // and context switch to it
    118         this_coroutine = dst;
     118        TL_SET( this_coroutine, dst );
    119119        assert( src->stack.context );
    120120        CtxSwitch( src->stack.context, dst->stack.context );
    121         this_coroutine = src;
     121        TL_SET( this_coroutine, src );
    122122
    123123        // set state of new coroutine to active
Note: See TracChangeset for help on using the changeset viewer.