Ignore:
Timestamp:
Aug 11, 2017, 10:10:26 AM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
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, resolv-new, with_gc
Children:
fd344aa
Parents:
8499c707
Message:

Fix concurrency library, tests, and keywords for references

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/coroutine

    r8499c707 r83a071f9  
    2626// Anything that is resumed is a coroutine.
    2727trait is_coroutine(dtype T) {
    28       void main(T * this);
    29       coroutine_desc * get_coroutine(T * this);
     28      void main(T & this);
     29      coroutine_desc * get_coroutine(T & this);
    3030};
    3131
    32 #define DECL_COROUTINE(X) static inline coroutine_desc* get_coroutine(X* this) { return &this->__cor; } void main(X* this)
     32#define DECL_COROUTINE(X) static inline coroutine_desc* get_coroutine(X& this) { return &this.__cor; } void main(X& this)
    3333
    3434//-----------------------------------------------------------------------------
     
    4545
    4646forall(dtype T | is_coroutine(T))
    47 static inline void resume(T * cor);
     47static inline void resume(T & cor);
    4848
    4949forall(dtype T | is_coroutine(T))
    50 void prime(T * cor);
     50void prime(T & cor);
    5151
    5252//-----------------------------------------------------------------------------
     
    8787// Resume implementation inlined for performance
    8888forall(dtype T | is_coroutine(T))
    89 static inline void resume(T * cor) {
     89static inline void resume(T & cor) {
    9090        coroutine_desc * src = this_coroutine;          // optimization
    9191        coroutine_desc * dst = get_coroutine(cor);
     
    9393        if( unlikely(!dst->stack.base) ) {
    9494                create_stack(&dst->stack, dst->stack.size);
    95                 CtxStart(cor, CtxInvokeCoroutine);
     95                CtxStart(&cor, CtxInvokeCoroutine);
    9696        }
    9797
Note: See TracChangeset for help on using the changeset viewer.