Ignore:
Timestamp:
Mar 30, 2018, 7:21:28 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
273cde6
Parents:
fae90d5
Message:

thread-local storage converted to structure and thread-local macros for access

File:
1 edited

Legend:

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

    rfae90d5 rb10affd  
    1010// Created On       : Mon Nov 28 12:27:26 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  8 16:10:31 2018
    13 // Update Count     : 4
     12// Last Modified On : Fri Mar 30 17:20:57 2018
     13// Update Count     : 9
    1414//
    1515
     
    9999// Wrapper for co
    100100void CoroutineCtxSwitch(coroutine_desc* src, coroutine_desc* dst) {
    101         verify( preemption_state.enabled || this_processor->do_terminate );
     101        verify( TL_GET( preemption_state ).enabled || TL_GET( this_processor )->do_terminate );
    102102        disable_interrupts();
    103103
     
    106106
    107107        // set new coroutine that task is executing
    108         this_coroutine = dst;
     108        TL_SET( this_coroutine, dst );
    109109
    110110        // context switch to specified coroutine
     
    117117
    118118        enable_interrupts( __cfaabi_dbg_ctx );
    119         verify( preemption_state.enabled || this_processor->do_terminate );
     119        verify( TL_GET( preemption_state ).enabled || TL_GET( this_processor )->do_terminate );
    120120} //ctxSwitchDirect
    121121
     
    172172
    173173        void __leave_coroutine(void) {
    174                 coroutine_desc * src = this_coroutine;          // optimization
     174                coroutine_desc * src = TL_GET( this_coroutine ); // optimization
    175175
    176176                assertf( src->starter != 0,
Note: See TracChangeset for help on using the changeset viewer.