Changeset 4269d1b
- Timestamp:
- Sep 1, 2023, 3:54:35 PM (15 months ago)
- Branches:
- master
- Children:
- 8a9a3ab
- Parents:
- 7e1dbd7
- Location:
- libcfa/src/concurrency
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/coroutine.cfa
r7e1dbd7 r4269d1b 344 344 bool poll() libcfa_public { return poll( active_coroutine() ); } 345 345 coroutine$ * resumer() libcfa_public { return active_coroutine()->last; } 346 coroutine$ * first_resumer() libcfa_public { return active_coroutine()->starter; } 346 347 347 348 // user facing ehm operations … … 358 359 359 360 coroutine$ * resumer( T & cor ) libcfa_public { return get_coroutine( cor )->last; } 361 coroutine$ * first_resumer( T & cor ) libcfa_public { return get_coroutine( cor )->starter; } 360 362 } 361 363 -
libcfa/src/concurrency/coroutine.hfa
r7e1dbd7 r4269d1b 124 124 src->state = Active; 125 125 126 if( unlikely(src->cancellation != 0p ) ) {126 if( unlikely(src->cancellation != 0p && src->cancellation != 1p) ) { 127 127 __cfactx_coroutine_unwind(src->cancellation, src); 128 128 } … … 169 169 coroutine$ * dst = get_coroutine(cor); 170 170 171 // printf("FROM RES src: %p, dest: %p\n", src, dst); 172 171 173 if( unlikely(dst->context.SP == 0p) ) { 172 174 __stack_prepare(&dst->stack, DEFAULT_STACK_SIZE); … … 188 190 // always done for performance testing 189 191 $ctx_switch( src, dst ); 190 if ( unlikely(dst->cancellation) ) { 192 193 if ( unlikely(src->cancellation == 1p) ) { 194 src->cancellation = 0p; 195 // we know dst hasn't been deallocated 191 196 __cfaehm_cancelled_coroutine( cor, dst, _default_vtable ); 192 197 } … … 222 227 bool poll(); 223 228 coroutine$ * resumer(); 229 coroutine$ * first_resumer(); 224 230 225 231 forall(T & | is_coroutine(T)) { … … 229 235 bool checked_poll( T & cor ); 230 236 coroutine$ * resumer( T & cor ); 237 coroutine$ * first_resumer( T & cor ); 231 238 } 232 239 -
libcfa/src/concurrency/exception.cfa
r7e1dbd7 r4269d1b 57 57 struct coroutine$ * src = (coroutine$ *)stop_param; 58 58 struct coroutine$ * dst = src->last; 59 59 dst->cancellation = 1p; 60 60 $ctx_switch( src, dst ); 61 61 abort();
Note: See TracChangeset
for help on using the changeset viewer.