Ignore:
Timestamp:
Aug 7, 2023, 12:35:53 PM (14 months ago)
Author:
caparsons <caparson@…>
Branches:
master
Children:
27f2bef
Parents:
ff7f6d07
Message:

added support for resuming at resumer, added test for support and cleaned up uneeded include in pingpong exception test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/coroutine.cfa

    rff7f6d07 rc3e510b  
    325325    // poll iff nonlocal ehm is enabled
    326326    bool checked_poll( T & cor ) libcfa_public { return get_coroutine( cor )->ehm_state.ehm_enabled ? poll( cor ) : false; }
     327
     328    coroutine$ * resumer( T & cor ) libcfa_public { return get_coroutine( cor )->last; }
    327329}
    328330
     
    338340}
    339341
     342forall(exceptT & | { void $throwResume(exceptT &); })
     343void resumeAt( coroutine$ * receiver, exceptT & ex ) libcfa_public {
     344    nonlocal_exception * nl_ex = alloc();
     345    (*nl_ex){ (exception_t *)&ex };
     346    lock( receiver->ehm_state.buffer_lock __cfaabi_dbg_ctx2 );
     347    append( receiver->ehm_state.ehm_buffer, nl_ex );
     348    unlock( receiver->ehm_state.buffer_lock );
     349}
     350
    340351// Local Variables: //
    341352// mode: c //
Note: See TracChangeset for help on using the changeset viewer.