Changeset 69c5c00 for libcfa/src/concurrency
- Timestamp:
- Oct 7, 2020, 6:08:35 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 6fbe9a5
- Parents:
- 41b8ea4
- Location:
- libcfa/src/concurrency
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/coroutine.cfa
r41b8ea4 r69c5c00 47 47 48 48 //----------------------------------------------------------------------------- 49 FORALL_DATA_INSTANCE(CoroutineCancelled, 50 (dtype coroutine_t | sized(coroutine_t)), (coroutine_t)) 49 FORALL_DATA_INSTANCE(CoroutineCancelled, (dtype coroutine_t), (coroutine_t)) 51 50 52 51 struct __cfaehm_node { … … 59 58 void mark_exception(CoroutineCancelled(T) *) {} 60 59 61 forall(dtype T | sized(T))60 forall(dtype T) 62 61 void copy(CoroutineCancelled(T) * dst, CoroutineCancelled(T) * src) { 63 62 dst->the_coroutine = src->the_coroutine; … … 77 76 exception_t * except = (exception_t *)(1 + (__cfaehm_node *)desc->cancellation); 78 77 78 // TODO: Remove explitate vtable set once trac#186 is fixed. 79 79 CoroutineCancelled(T) except; 80 except.virtual_table = &get_exception_vtable(&except); 80 81 except.the_coroutine = &cor; 81 82 except.the_exception = except; -
libcfa/src/concurrency/coroutine.hfa
r41b8ea4 r69c5c00 22 22 //----------------------------------------------------------------------------- 23 23 // Exception thrown from resume when a coroutine stack is cancelled. 24 // Should not have to be be sized (see trac #196). 25 FORALL_DATA_EXCEPTION(CoroutineCancelled, 26 (dtype coroutine_t | sized(coroutine_t)), (coroutine_t)) ( 24 FORALL_DATA_EXCEPTION(CoroutineCancelled, (dtype coroutine_t), (coroutine_t)) ( 27 25 coroutine_t * the_coroutine; 28 26 exception_t * the_exception; … … 30 28 31 29 forall(dtype T) 32 void mark_exception(CoroutineCancelled(T) *);33 34 forall(dtype T | sized(T))35 30 void copy(CoroutineCancelled(T) * dst, CoroutineCancelled(T) * src); 36 31 … … 42 37 // Anything that implements this trait can be resumed. 43 38 // Anything that is resumed is a coroutine. 44 trait is_coroutine(dtype T | sized(T)45 | is_resumption_exception(CoroutineCancelled(T) )46 | VTABLE_ASSERTION(CoroutineCancelled,(T))) {39 trait is_coroutine(dtype T 40 | is_resumption_exception(CoroutineCancelled(T), 41 CoroutineCancelled_vtable(T))) { 47 42 void main(T & this); 48 43 $coroutine * get_coroutine(T & this);
Note:
See TracChangeset
for help on using the changeset viewer.