- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/coroutine.cfa
re3fea42 r09f357ec 10 10 // Created On : Mon Nov 28 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Feb 4 12:29:25 202013 // Update Count : 1 612 // Last Modified On : Thu Dec 5 14:37:29 2019 13 // Update Count : 15 14 14 // 15 15 … … 89 89 } 90 90 91 void ?{}( coroutine_desc & this, const char name[], void * storage, size_t storageSize ) with( this ) {91 void ?{}( coroutine_desc & this, const char * name, void * storage, size_t storageSize ) with( this ) { 92 92 (this.context){0p, 0p}; 93 93 (this.stack){storage, storageSize}; … … 187 187 // is not inline (We can't inline Cforall in C) 188 188 extern "C" { 189 void __suspend_internal(void) { 190 suspend(); 191 } 192 193 void __leave_coroutine( coroutine_desc * src ) { 189 void __leave_coroutine( struct coroutine_desc * src ) { 194 190 coroutine_desc * starter = src->cancellation != 0 ? src->last : src->starter; 195 191 … … 207 203 CoroutineCtxSwitch( src, starter ); 208 204 } 205 206 struct coroutine_desc * __finish_coroutine(void) { 207 struct coroutine_desc * cor = kernelTLS.this_thread->curr_cor; 208 209 if(cor->state == Primed) { 210 suspend(); 211 } 212 213 cor->state = Active; 214 215 return cor; 216 } 209 217 } 210 218
Note: See TracChangeset
for help on using the changeset viewer.