Ignore:
Timestamp:
Nov 6, 2020, 4:48:52 PM (4 years ago)
Author:
m3zulfiq <m3zulfiq@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
75baaa3
Parents:
55acc3a (diff), 836c9925 (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 branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    r55acc3a r139775e  
    6363void prime(T & cor);
    6464
    65 static inline struct $coroutine * active_coroutine() { return TL_GET( this_thread )->curr_cor; }
     65static inline struct $coroutine * active_coroutine() { return active_thread()->curr_cor; }
    6666
    6767//-----------------------------------------------------------------------------
     
    8787
    8888        // set new coroutine that task is executing
    89         TL_GET( this_thread )->curr_cor = dst;
     89        active_thread()->curr_cor = dst;
    9090
    9191        // context switch to specified coroutine
     
    112112                // will also migrate which means this value will
    113113                // stay in syn with the TLS
    114                 $coroutine * src = TL_GET( this_thread )->curr_cor;
     114                $coroutine * src = active_coroutine();
    115115
    116116                assertf( src->last != 0,
     
    138138        // will also migrate which means this value will
    139139        // stay in syn with the TLS
    140         $coroutine * src = TL_GET( this_thread )->curr_cor;
     140        $coroutine * src = active_coroutine();
    141141        $coroutine * dst = get_coroutine(cor);
    142142
    143143        if( unlikely(dst->context.SP == 0p) ) {
    144                 TL_GET( this_thread )->curr_cor = dst;
     144                active_thread()->curr_cor = dst;
    145145                __stack_prepare(&dst->stack, 65000);
    146146                __cfactx_start(main, dst, cor, __cfactx_invoke_coroutine);
    147                 TL_GET( this_thread )->curr_cor = src;
     147                active_thread()->curr_cor = src;
    148148        }
    149149
     
    175175        // will also migrate which means this value will
    176176        // stay in syn with the TLS
    177         $coroutine * src = TL_GET( this_thread )->curr_cor;
     177        $coroutine * src = active_coroutine();
    178178
    179179        // not resuming self ?
Note: See TracChangeset for help on using the changeset viewer.