Ignore:
File:
1 edited

Legend:

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

    rc3b9d639 reaf269d  
    2222//-----------------------------------------------------------------------------
    2323// Exception thrown from resume when a coroutine stack is cancelled.
    24 forall(coroutine_t &)
    25 exception CoroutineCancelled {
     24EHM_FORALL_EXCEPTION(CoroutineCancelled, (coroutine_t &), (coroutine_t)) (
    2625        coroutine_t * the_coroutine;
    2726        exception_t * the_exception;
    28 };
     27);
    2928
    3029forall(T &)
     
    3837// Anything that implements this trait can be resumed.
    3938// Anything that is resumed is a coroutine.
    40 trait is_coroutine(T & | IS_RESUMPTION_EXCEPTION(CoroutineCancelled(T))) {
     39trait is_coroutine(T & | IS_RESUMPTION_EXCEPTION(CoroutineCancelled, (T))) {
    4140        void main(T & this);
    4241        coroutine$ * get_coroutine(T & this);
     
    6160//-----------------------------------------------------------------------------
    6261// Public coroutine API
    63 forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled(T)); })
     62forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)); })
    6463void prime(T & cor);
    6564
     
    114113
    115114extern void __stack_prepare( __stack_info_t * this, size_t size /* ignored if storage already allocated */);
     115extern void __stack_clean  ( __stack_info_t * this );
     116
    116117
    117118// Suspend implementation inlined for performance
     
    140141forall(T & | is_coroutine(T))
    141142void __cfaehm_cancelled_coroutine(
    142         T & cor, coroutine$ * desc, EHM_DEFAULT_VTABLE(CoroutineCancelled(T)) );
     143        T & cor, coroutine$ * desc, EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)) );
    143144
    144145// Resume implementation inlined for performance
    145 forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled(T)); })
     146forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)); })
    146147static inline T & resume(T & cor) {
    147148        // optimization : read TLS once and reuse it
Note: See TracChangeset for help on using the changeset viewer.