Changeset 23edb61
- Timestamp:
- Aug 10, 2023, 2:53:42 PM (21 months ago)
- Branches:
- master
- Children:
- 9ff71ff
- Parents:
- 3318dff
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified libcfa/src/concurrency/coroutine.cfa ¶
r3318dff r23edb61 78 78 free( desc->cancellation ); 79 79 desc->cancellation = 0p; 80 } 81 82 // helper for popping from coroutine's ehm buffer 83 inline nonlocal_exception * pop_ehm_head( coroutine$ * this ) { 84 lock( this->ehm_state.buffer_lock __cfaabi_dbg_ctx2 ); 85 nonlocal_exception * nl_ex = pop_head( this->ehm_state.ehm_buffer ); 86 unlock( this->ehm_state.buffer_lock ); 87 return nl_ex; 80 88 } 81 89 … … 128 136 129 137 void ^?{}(coroutine$& this) libcfa_public { 138 // handle any leftover pending non-local exceptions 139 nonlocal_exception * nl_ex = pop_ehm_head( &this ); 140 unsigned unhandled_ex = 0; 141 142 // if any leftover exceptions handle 143 while ( nl_ex != 0p ){ 144 unhandled_ex++; 145 free( nl_ex->the_exception ); 146 free( nl_ex ); 147 nl_ex = pop_ehm_head( &this ); 148 } 149 150 #ifdef __CFA_DEBUG__ 151 if ( unhandled_ex > 0 ) 152 printf( "Warning: Coroutine %p exited with %u pending nonlocal exceptions.\n", &this, unhandled_ex ); 153 #endif 154 130 155 if(this.state != Halted && this.state != Start && this.state != Primed) { 131 156 coroutine$ * src = active_coroutine(); … … 291 316 // non local ehm routines 292 317 293 // helper for popping from coroutine's ehm buffer294 inline nonlocal_exception * pop_ehm_head( coroutine$ * this ) {295 lock( this->ehm_state.buffer_lock __cfaabi_dbg_ctx2 );296 nonlocal_exception * nl_ex = pop_head( this->ehm_state.ehm_buffer );297 unlock( this->ehm_state.buffer_lock );298 return nl_ex;299 }300 301 318 void defaultResumeAtHandler( exception_t * except ) { 302 319 __cfaehm_allocate_exception( except );
Note: See TracChangeset
for help on using the changeset viewer.