Ignore:
Timestamp:
May 26, 2022, 10:21:17 AM (2 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
5416b44
Parents:
c715e5f
Message:

Clean-up the exception interface. It should be slightly more like the final - non-macro - interface.

Location:
libcfa/src/concurrency
Files:
4 edited

Legend:

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

    rc715e5f rc3b9d639  
    6262forall(T & | is_coroutine(T))
    6363void __cfaehm_cancelled_coroutine(
    64                 T & cor, coroutine$ * desc, EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)) ) libcfa_public {
     64                T & cor, coroutine$ * desc, EHM_DEFAULT_VTABLE(CoroutineCancelled(T)) ) libcfa_public {
    6565        verify( desc->cancellation );
    6666        desc->state = Cancelled;
     
    146146// Part of the Public API
    147147// Not inline since only ever called once per coroutine
    148 forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)); })
     148forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled(T)); })
    149149void prime(T& cor) libcfa_public {
    150150        coroutine$* this = get_coroutine(cor);
  • libcfa/src/concurrency/coroutine.hfa

    rc715e5f rc3b9d639  
    3838// Anything that implements this trait can be resumed.
    3939// Anything that is resumed is a coroutine.
    40 trait is_coroutine(T & | IS_RESUMPTION_EXCEPTION(CoroutineCancelled, (T))) {
     40trait is_coroutine(T & | IS_RESUMPTION_EXCEPTION(CoroutineCancelled(T))) {
    4141        void main(T & this);
    4242        coroutine$ * get_coroutine(T & this);
     
    6161//-----------------------------------------------------------------------------
    6262// Public coroutine API
    63 forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)); })
     63forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled(T)); })
    6464void prime(T & cor);
    6565
     
    140140forall(T & | is_coroutine(T))
    141141void __cfaehm_cancelled_coroutine(
    142         T & cor, coroutine$ * desc, EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)) );
     142        T & cor, coroutine$ * desc, EHM_DEFAULT_VTABLE(CoroutineCancelled(T)) );
    143143
    144144// Resume implementation inlined for performance
    145 forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)); })
     145forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled(T)); })
    146146static inline T & resume(T & cor) {
    147147        // optimization : read TLS once and reuse it
  • libcfa/src/concurrency/thread.cfa

    rc715e5f rc3b9d639  
    8989}
    9090
    91 forall(T & | is_thread(T) | IS_EXCEPTION(ThreadCancelled, (T))
    92     | { EHM_DEFAULT_VTABLE(ThreadCancelled, (T)); })
     91forall(T & | is_thread(T) | IS_EXCEPTION(ThreadCancelled(T))
     92    | { EHM_DEFAULT_VTABLE(ThreadCancelled(T)); })
    9393void ?{}( thread_dtor_guard_t & this,
    9494                T & thrd, void(*cancelHandler)(ThreadCancelled(T) &)) {
     
    168168
    169169//-----------------------------------------------------------------------------
    170 forall(T & | is_thread(T) | IS_RESUMPTION_EXCEPTION(ThreadCancelled, (T))
    171     | { EHM_DEFAULT_VTABLE(ThreadCancelled, (T)); })
     170forall(T & | is_thread(T) | IS_RESUMPTION_EXCEPTION(ThreadCancelled(T))
     171        | { EHM_DEFAULT_VTABLE(ThreadCancelled(T)); })
    172172T & join( T & this ) {
    173173        thread_dtor_guard_t guard = { this, defaultResumptionHandler };
  • libcfa/src/concurrency/thread.hfa

    rc715e5f rc3b9d639  
    8080};
    8181
    82 forall( T & | is_thread(T) | IS_EXCEPTION(ThreadCancelled, (T))
    83     | { EHM_DEFAULT_VTABLE(ThreadCancelled, (T)); })
     82forall( T & | is_thread(T) | IS_EXCEPTION(ThreadCancelled(T))
     83        | { EHM_DEFAULT_VTABLE(ThreadCancelled(T)); })
    8484void ?{}( thread_dtor_guard_t & this, T & thrd, void(*)(ThreadCancelled(T) &) );
    8585void ^?{}( thread_dtor_guard_t & this );
     
    127127//----------
    128128// join
    129 forall( T & | is_thread(T) | IS_RESUMPTION_EXCEPTION(ThreadCancelled, (T))
    130     | { EHM_DEFAULT_VTABLE(ThreadCancelled, (T)); })
     129forall( T & | is_thread(T) | IS_RESUMPTION_EXCEPTION(ThreadCancelled(T))
     130        | { EHM_DEFAULT_VTABLE(ThreadCancelled(T)); })
    131131T & join( T & this );
    132132
Note: See TracChangeset for help on using the changeset viewer.