Changeset c86ee4c for libcfa/src/concurrency/coroutine.cfa
- Timestamp:
- Jul 7, 2021, 6:24:42 PM (4 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- d83b266
- Parents:
- 1f45c7d (diff), b1a2c4a (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
-
libcfa/src/concurrency/coroutine.cfa (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/coroutine.cfa
r1f45c7d rc86ee4c 37 37 38 38 extern "C" { 39 void _CtxCoroutine_Unwind(struct _Unwind_Exception * storage, struct $coroutine*) __attribute__ ((__noreturn__));39 void _CtxCoroutine_Unwind(struct _Unwind_Exception * storage, struct coroutine$ *) __attribute__ ((__noreturn__)); 40 40 static void _CtxCoroutine_UnwindCleanup(_Unwind_Reason_Code, struct _Unwind_Exception *) __attribute__ ((__noreturn__)); 41 41 static void _CtxCoroutine_UnwindCleanup(_Unwind_Reason_Code, struct _Unwind_Exception *) { … … 62 62 forall(T & | is_coroutine(T)) 63 63 void __cfaehm_cancelled_coroutine( 64 T & cor, $coroutine* desc, EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)) ) {64 T & cor, coroutine$ * desc, EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)) ) { 65 65 verify( desc->cancellation ); 66 66 desc->state = Cancelled; … … 114 114 } 115 115 116 void ?{}( $coroutine& this, const char name[], void * storage, size_t storageSize ) with( this ) {116 void ?{}( coroutine$ & this, const char name[], void * storage, size_t storageSize ) with( this ) { 117 117 (this.context){0p, 0p}; 118 118 (this.stack){storage, storageSize}; … … 124 124 } 125 125 126 void ^?{}( $coroutine& this) {126 void ^?{}(coroutine$& this) { 127 127 if(this.state != Halted && this.state != Start && this.state != Primed) { 128 $coroutine* src = active_coroutine();129 $coroutine* dst = &this;128 coroutine$ * src = active_coroutine(); 129 coroutine$ * dst = &this; 130 130 131 131 struct _Unwind_Exception storage; … … 148 148 forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)); }) 149 149 void prime(T& cor) { 150 $coroutine* this = get_coroutine(cor);150 coroutine$* this = get_coroutine(cor); 151 151 assert(this->state == Start); 152 152 … … 248 248 // is not inline (We can't inline Cforall in C) 249 249 extern "C" { 250 void __cfactx_cor_leave( struct $coroutine* src ) {251 $coroutine* starter = src->cancellation != 0 ? src->last : src->starter;250 void __cfactx_cor_leave( struct coroutine$ * src ) { 251 coroutine$ * starter = src->cancellation != 0 ? src->last : src->starter; 252 252 253 253 src->state = Halted; … … 265 265 } 266 266 267 struct $coroutine* __cfactx_cor_finish(void) {268 struct $coroutine* cor = active_coroutine();267 struct coroutine$ * __cfactx_cor_finish(void) { 268 struct coroutine$ * cor = active_coroutine(); 269 269 270 270 // get the active thread once 271 $thread* athrd = active_thread();271 thread$ * athrd = active_thread(); 272 272 273 273 /* paranoid */ verify( athrd->corctx_flag );
Note:
See TracChangeset
for help on using the changeset viewer.