Ignore:
Timestamp:
Jul 10, 2023, 11:14:13 AM (2 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
c3f7dd9
Parents:
e6e1a12 (diff), b29a1e8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    re6e1a12 r713905fd  
    1919#include "invoke.h"
    2020#include "../exception.hfa"
     21
     22//-----------------------------------------------------------------------------
     23// Type used to store and queue nonlocal exceptions on coroutines
     24struct nonlocal_exception {
     25    exception_t * the_exception;
     26    nonlocal_exception * next;
     27};
     28static inline void ?{} ( nonlocal_exception & this, exception_t * ex ) with(this) {
     29    the_exception = ex;
     30    next = 0p;
     31}
     32
     33static inline nonlocal_exception *& get_next( nonlocal_exception & this ) __attribute__((const)) {
     34    return this.next;
     35}
    2136
    2237//-----------------------------------------------------------------------------
     
    203218}
    204219
     220// non local ehm routines
     221forall(T & | is_coroutine(T)) {
     222    void enable_ehm( T & cor );
     223    void disable_ehm( T & cor );
     224    bool poll( T & cor );
     225    bool checked_poll( T & cor );
     226}
     227
     228// trait for exceptions able to be resumed at another coroutine
     229forall(exceptT &, T & | is_coroutine(T))
     230trait ehm_resume_at { void $throwResume(exceptT &); };
     231
     232forall(exceptT &, T & | ehm_resume_at( exceptT, T ))
     233void resumeAt( T & receiver, exceptT & ex );
     234
    205235// Local Variables: //
    206236// mode: c //
Note: See TracChangeset for help on using the changeset viewer.