Changeset 147a137


Ignore:
Timestamp:
Oct 1, 2023, 12:05:08 PM (5 months ago)
Author:
caparsons <caparson@…>
Branches:
master
Children:
fd775ae
Parents:
1e7a765
Message:

added enable/disable ehm with no params for coroutines

Location:
libcfa/src/concurrency
Files:
2 edited

Legend:

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

    r1e7a765 r147a137  
    343343
    344344bool poll() libcfa_public { return poll( active_coroutine() ); }
     345void enable_ehm() libcfa_public { active_coroutine()->ehm_state.ehm_enabled = true; }
     346void disable_ehm() libcfa_public { active_coroutine()->ehm_state.ehm_enabled = false; }
     347bool checked_poll() libcfa_public { return active_coroutine()->ehm_state.ehm_enabled ? poll( active_coroutine() ) : false; }
    345348coroutine$ * resumer() libcfa_public { return active_coroutine()->last; }
    346349coroutine$ * first_resumer() libcfa_public { return active_coroutine()->starter; }
  • libcfa/src/concurrency/coroutine.hfa

    r1e7a765 r147a137  
    224224
    225225// non local ehm and coroutine utility routines
     226void enable_ehm();
     227void disable_ehm();
    226228bool poll( coroutine$ * cor );
    227229bool poll();
     230bool checked_poll();
    228231coroutine$ * resumer();
    229232coroutine$ * first_resumer();
    230233
    231234forall(T & | is_coroutine(T)) {
    232     void enable_ehm( T & cor );
    233     void disable_ehm( T & cor );
     235    void enable_ehm( T & cor );         // enable checking non-local exceptions for cor via checked_poll
     236    void disable_ehm( T & cor );        // disable checking non-local exceptions for cor via checked_poll
    234237    bool poll( T & cor );
    235     bool checked_poll( T & cor );
     238    bool checked_poll( T & cor );       // check for non-local exceptions while respecting enable/disable
    236239    coroutine$ * resumer( T & cor );
    237240    coroutine$ * first_resumer( T & cor );
Note: See TracChangeset for help on using the changeset viewer.