Changeset 4aa2fb2 for src/libcfa/concurrency/coroutine
- Timestamp:
- Jun 16, 2017, 9:07:21 PM (7 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:
- 42b0d73
- Parents:
- 667c7da
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/coroutine
r667c7da r4aa2fb2 71 71 // Suspend implementation inlined for performance 72 72 static inline void suspend() { 73 73 coroutine_desc * src = this_coroutine(); // optimization 74 74 75 75 assertf( src->last != 0, … … 91 91 coroutine_desc * dst = get_coroutine(cor); 92 92 93 93 if( unlikely(!dst->stack.base) ) { 94 94 create_stack(&dst->stack, dst->stack.size); 95 95 CtxStart(cor, CtxInvokeCoroutine); 96 96 } 97 97 98 98 // not resuming self ? 99 99 if ( src != dst ) { 100 100 assertf( dst->state != Halted , … … 103 103 src->name, src, dst->name, dst ); 104 104 105 105 // set last resumer 106 106 dst->last = src; 107 107 } // if 108 108 109 109 // always done for performance testing 110 110 CoroutineCtxSwitch( src, dst ); 111 111 } … … 114 114 coroutine_desc * src = this_coroutine(); // optimization 115 115 116 116 // not resuming self ? 117 117 if ( src != dst ) { 118 118 assertf( dst->state != Halted , … … 121 121 src->name, src, dst->name, dst ); 122 122 123 123 // set last resumer 124 124 dst->last = src; 125 125 } // if 126 126 127 127 // always done for performance testing 128 128 CoroutineCtxSwitch( src, dst ); 129 129 }
Note: See TracChangeset
for help on using the changeset viewer.