Ignore:
Timestamp:
Mar 15, 2017, 5:02:25 PM (7 years ago)
Author:
Aaron Moss <a3moss@…>
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:
f2e40a9f
Parents:
5a3ac84 (diff), 29f44a74 (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 moved

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/coroutine

    r5a3ac84 r9b443c7f  
    66// file "LICENCE" distributed with Cforall.
    77//
    8 // coroutines --
     8// coroutine --
    99//
    1010// Author           : Thierry Delisle
     
    2727trait is_coroutine(dtype T) {
    2828      void main(T * this);
    29       coroutine * get_coroutine(T * this);
     29      coroutine_desc * get_coroutine(T * this);
    3030};
    3131
    32 #define DECL_COROUTINE(X) static inline coroutine* get_coroutine(X* this) { return &this->c; } void main(X* this)
     32#define DECL_COROUTINE(X) static inline coroutine_desc* get_coroutine(X* this) { return &this->c; } void main(X* this)
    3333
    3434//-----------------------------------------------------------------------------
    3535// Ctors and dtors
    3636void ?{}(coStack_t * this);
    37 void ?{}(coroutine * this);
    38 void ?{}(coroutine * this, const char * name);
     37void ?{}(coroutine_desc * this);
     38void ?{}(coroutine_desc * this, const char * name);
    3939void ^?{}(coStack_t * this);
    40 void ^?{}(coroutine * this);
     40void ^?{}(coroutine_desc * this);
    4141
    4242//-----------------------------------------------------------------------------
     
    6363
    6464// Get current coroutine
    65 coroutine * this_coroutine(void);
     65coroutine_desc * this_coroutine(void);
    6666
    6767// Private wrappers for context switch and stack creation
    68 extern void CoroutineCtxSwitch(coroutine * src, coroutine * dst);
     68extern void CoroutineCtxSwitch(coroutine_desc * src, coroutine_desc * dst);
    6969extern void create_stack( coStack_t * this, unsigned int storageSize );
    7070
    7171// Suspend implementation inlined for performance
    7272static inline void suspend() {
    73       coroutine * src = this_coroutine();               // optimization
     73      coroutine_desc * src = this_coroutine();          // optimization
    7474
    7575        assertf( src->last != 0,
     
    8888forall(dtype T | is_coroutine(T))
    8989static inline void resume(T * cor) {
    90         coroutine * src = this_coroutine();             // optimization
    91         coroutine * dst = get_coroutine(cor);
     90        coroutine_desc * src = this_coroutine();                // optimization
     91        coroutine_desc * dst = get_coroutine(cor);
    9292
    9393      if( unlikely(!dst->stack.base) ) {
     
    111111}
    112112
    113 static inline void resume(coroutine * dst) {
    114         coroutine * src = this_coroutine();             // optimization
     113static inline void resume(coroutine_desc * dst) {
     114        coroutine_desc * src = this_coroutine();                // optimization
    115115
    116116      // not resuming self ?
Note: See TracChangeset for help on using the changeset viewer.