Changeset c3b9d639 for libcfa/src/concurrency
- Timestamp:
- May 26, 2022, 10:21:17 AM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 5416b44
- Parents:
- c715e5f
- Location:
- libcfa/src/concurrency
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/coroutine.cfa
rc715e5f rc3b9d639 62 62 forall(T & | is_coroutine(T)) 63 63 void __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 { 65 65 verify( desc->cancellation ); 66 66 desc->state = Cancelled; … … 146 146 // Part of the Public API 147 147 // Not inline since only ever called once per coroutine 148 forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled ,(T)); })148 forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled(T)); }) 149 149 void prime(T& cor) libcfa_public { 150 150 coroutine$* this = get_coroutine(cor); -
libcfa/src/concurrency/coroutine.hfa
rc715e5f rc3b9d639 38 38 // Anything that implements this trait can be resumed. 39 39 // Anything that is resumed is a coroutine. 40 trait is_coroutine(T & | IS_RESUMPTION_EXCEPTION(CoroutineCancelled ,(T))) {40 trait is_coroutine(T & | IS_RESUMPTION_EXCEPTION(CoroutineCancelled(T))) { 41 41 void main(T & this); 42 42 coroutine$ * get_coroutine(T & this); … … 61 61 //----------------------------------------------------------------------------- 62 62 // Public coroutine API 63 forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled ,(T)); })63 forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled(T)); }) 64 64 void prime(T & cor); 65 65 … … 140 140 forall(T & | is_coroutine(T)) 141 141 void __cfaehm_cancelled_coroutine( 142 T & cor, coroutine$ * desc, EHM_DEFAULT_VTABLE(CoroutineCancelled ,(T)) );142 T & cor, coroutine$ * desc, EHM_DEFAULT_VTABLE(CoroutineCancelled(T)) ); 143 143 144 144 // Resume implementation inlined for performance 145 forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled ,(T)); })145 forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled(T)); }) 146 146 static inline T & resume(T & cor) { 147 147 // optimization : read TLS once and reuse it -
libcfa/src/concurrency/thread.cfa
rc715e5f rc3b9d639 89 89 } 90 90 91 forall(T & | is_thread(T) | IS_EXCEPTION(ThreadCancelled ,(T))92 | { EHM_DEFAULT_VTABLE(ThreadCancelled ,(T)); })91 forall(T & | is_thread(T) | IS_EXCEPTION(ThreadCancelled(T)) 92 | { EHM_DEFAULT_VTABLE(ThreadCancelled(T)); }) 93 93 void ?{}( thread_dtor_guard_t & this, 94 94 T & thrd, void(*cancelHandler)(ThreadCancelled(T) &)) { … … 168 168 169 169 //----------------------------------------------------------------------------- 170 forall(T & | is_thread(T) | IS_RESUMPTION_EXCEPTION(ThreadCancelled ,(T))171 | { EHM_DEFAULT_VTABLE(ThreadCancelled,(T)); })170 forall(T & | is_thread(T) | IS_RESUMPTION_EXCEPTION(ThreadCancelled(T)) 171 | { EHM_DEFAULT_VTABLE(ThreadCancelled(T)); }) 172 172 T & join( T & this ) { 173 173 thread_dtor_guard_t guard = { this, defaultResumptionHandler }; -
libcfa/src/concurrency/thread.hfa
rc715e5f rc3b9d639 80 80 }; 81 81 82 forall( T & | is_thread(T) | IS_EXCEPTION(ThreadCancelled ,(T))83 | { EHM_DEFAULT_VTABLE(ThreadCancelled,(T)); })82 forall( T & | is_thread(T) | IS_EXCEPTION(ThreadCancelled(T)) 83 | { EHM_DEFAULT_VTABLE(ThreadCancelled(T)); }) 84 84 void ?{}( thread_dtor_guard_t & this, T & thrd, void(*)(ThreadCancelled(T) &) ); 85 85 void ^?{}( thread_dtor_guard_t & this ); … … 127 127 //---------- 128 128 // join 129 forall( T & | is_thread(T) | IS_RESUMPTION_EXCEPTION(ThreadCancelled ,(T))130 | { EHM_DEFAULT_VTABLE(ThreadCancelled,(T)); })129 forall( T & | is_thread(T) | IS_RESUMPTION_EXCEPTION(ThreadCancelled(T)) 130 | { EHM_DEFAULT_VTABLE(ThreadCancelled(T)); }) 131 131 T & join( T & this ); 132 132
Note: See TracChangeset
for help on using the changeset viewer.