Changeset 3c06bba for libcfa/src/concurrency/coroutine.cfa
- Timestamp:
- Apr 15, 2019, 4:06:40 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- deca0f5
- Parents:
- 5c1a531
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/coroutine.cfa
r5c1a531 r3c06bba 124 124 } 125 125 126 // Wrapper for co127 void CoroutineCtxSwitch(coroutine_desc* src, coroutine_desc* dst) {128 // set state of current coroutine to inactive129 src->state = src->state == Halted ? Halted : Inactive;130 131 // set new coroutine that task is executing132 TL_GET( this_thread )->curr_cor = dst;133 134 // context switch to specified coroutine135 verify( dst->context.SP );136 CtxSwitch( &src->context, &dst->context );137 // when CtxSwitch returns we are back in the src coroutine138 139 // set state of new coroutine to active140 src->state = Active;141 142 if( unlikely(src->cancellation != NULL) ) {143 _CtxCoroutine_Unwind(src->cancellation, src);144 }145 }146 147 126 [void *, size_t] __stack_alloc( size_t storageSize ) { 148 127 static const size_t stack_data_size = libCeiling( sizeof(__stack_t), 16 ); // minimum alignment
Note: See TracChangeset
for help on using the changeset viewer.