Changeset b4d65c7 for src/libcfa/concurrency/coroutines
- Timestamp:
- Feb 6, 2017, 4:19:53 PM (9 years ago)
- 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:
- 424931d, fe26fbf
- Parents:
- c0aa336 (diff), 6a5f0e7 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/coroutines
rc0aa336 rb4d65c7 30 30 }; 31 31 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* get_coroutine(X* this) { return &this->c; } void main(X* this) 33 33 34 34 //----------------------------------------------------------------------------- … … 65 65 66 66 // Private wrappers for context switch and stack creation 67 extern void corCxtSw(coroutine * src, coroutine * dst);67 extern void CoroutineCtxSwitch(coroutine * src, coroutine * dst); 68 68 extern void create_stack( coStack_t * this, unsigned int storageSize ); 69 69 … … 81 81 src->name, src, src->last->name, src->last ); 82 82 83 corCxtSw( src, src->last );83 CoroutineCtxSwitch( src, src->last ); 84 84 } 85 85 … … 107 107 108 108 // always done for performance testing 109 corCxtSw( src, dst ); 109 CoroutineCtxSwitch( src, dst ); 110 } 111 112 static inline void resume(coroutine * dst) { 113 coroutine * src = this_coroutine(); // optimization 114 115 // not resuming self ? 116 if ( src != dst ) { 117 assertf( dst->notHalted , 118 "Attempt by coroutine %.256s (%p) to resume terminated coroutine %.256s (%p).\n" 119 "Possible cause is terminated coroutine's main routine has already returned.", 120 src->name, src, dst->name, dst ); 121 122 // set last resumer 123 dst->last = src; 124 } // if 125 126 // always done for performance testing 127 CoroutineCtxSwitch( src, dst ); 110 128 } 111 129
Note:
See TracChangeset
for help on using the changeset viewer.