Changeset cce0807 for libcfa/src/concurrency
- Timestamp:
- Nov 14, 2023, 12:18:04 PM (12 months ago)
- Branches:
- master
- Children:
- df8ba61a
- Parents:
- c46c999
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/coroutine.cfa
rc46c999 rcce0807 318 318 void defaultResumeAtHandler( exception_t * except ) { 319 319 __cfaehm_allocate_exception( except ); 320 free( except );321 320 __cfaehm_begin_unwind( (void(*)(exception_t *))defaultTerminationHandler ); 322 321 } 322 323 struct ehm_cleanup { 324 exception_t * ex; 325 }; 326 327 void ^?{}( ehm_cleanup & this ) { free( this.ex ); } 323 328 324 329 bool poll( coroutine$ * cor ) libcfa_public { … … 330 335 // otherwise loop and throwResume all pending exceptions 331 336 while ( nl_ex != 0p ){ 332 exception_t * ex = nl_ex->the_exception;337 ehm_cleanup ex_holder{ nl_ex->the_exception }; 333 338 free( nl_ex ); 334 __cfaehm_throw_resume( ex , defaultResumeAtHandler );339 __cfaehm_throw_resume( ex_holder.ex , defaultResumeAtHandler ); 335 340 336 // only reached if resumption handled. other dealloc handled in defaultResumeAtHandler337 free( ex );338 341 nl_ex = pop_ehm_head( cor ); 339 342 }
Note: See TracChangeset
for help on using the changeset viewer.