- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/coroutines
r0c92c9f r77e6fcb 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 //----------------------------------------------------------------------------- … … 110 110 } 111 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 ); 128 } 129 112 130 #endif //COROUTINES_H 113 131
Note: See TracChangeset
for help on using the changeset viewer.