Ignore:
File:
1 edited

Legend:

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

    reaf269d rc3b9d639  
    2222//-----------------------------------------------------------------------------
    2323// Exception thrown from resume when a coroutine stack is cancelled.
    24 EHM_FORALL_EXCEPTION(CoroutineCancelled, (coroutine_t &), (coroutine_t)) (
     24forall(coroutine_t &)
     25exception CoroutineCancelled {
    2526        coroutine_t * the_coroutine;
    2627        exception_t * the_exception;
    27 );
     28};
    2829
    2930forall(T &)
     
    3738// Anything that implements this trait can be resumed.
    3839// Anything that is resumed is a coroutine.
    39 trait is_coroutine(T & | IS_RESUMPTION_EXCEPTION(CoroutineCancelled, (T))) {
     40trait is_coroutine(T & | IS_RESUMPTION_EXCEPTION(CoroutineCancelled(T))) {
    4041        void main(T & this);
    4142        coroutine$ * get_coroutine(T & this);
     
    6061//-----------------------------------------------------------------------------
    6162// Public coroutine API
    62 forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)); })
     63forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled(T)); })
    6364void prime(T & cor);
    6465
     
    113114
    114115extern void __stack_prepare( __stack_info_t * this, size_t size /* ignored if storage already allocated */);
    115 extern void __stack_clean  ( __stack_info_t * this );
    116 
    117116
    118117// Suspend implementation inlined for performance
     
    141140forall(T & | is_coroutine(T))
    142141void __cfaehm_cancelled_coroutine(
    143         T & cor, coroutine$ * desc, EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)) );
     142        T & cor, coroutine$ * desc, EHM_DEFAULT_VTABLE(CoroutineCancelled(T)) );
    144143
    145144// Resume implementation inlined for performance
    146 forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)); })
     145forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled(T)); })
    147146static inline T & resume(T & cor) {
    148147        // optimization : read TLS once and reuse it
Note: See TracChangeset for help on using the changeset viewer.