- File:
- 
      - 1 edited
 
 - 
          
  libcfa/src/concurrency/coroutine.cfa (modified) (3 diffs)
 
Legend:
- Unmodified
- Added
- Removed
- 
      libcfa/src/concurrency/coroutine.cfar23edb61 r3318dff 78 78 free( desc->cancellation ); 79 79 desc->cancellation = 0p; 80 }81 82 // helper for popping from coroutine's ehm buffer83 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;88 80 } 89 81 … … 136 128 137 129 void ^?{}(coroutine$& this) libcfa_public { 138 // handle any leftover pending non-local exceptions139 nonlocal_exception * nl_ex = pop_ehm_head( &this );140 unsigned unhandled_ex = 0;141 142 // if any leftover exceptions handle143 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 #endif154 155 130 if(this.state != Halted && this.state != Start && this.state != Primed) { 156 131 coroutine$ * src = active_coroutine(); … … 316 291 // non local ehm routines 317 292 293 // helper for popping from coroutine's ehm buffer 294 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 318 301 void defaultResumeAtHandler( exception_t * except ) { 319 302 __cfaehm_allocate_exception( except ); 
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  