- File:
-
- 1 edited
-
libcfa/src/concurrency/coroutine.cfa (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/coroutine.cfa
rc960331 r290553a 10 10 // Created On : Mon Nov 28 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Oct 23 23:05:24202013 // Update Count : 2 212 // Last Modified On : Tue May 26 22:06:09 2020 13 // Update Count : 21 14 14 // 15 15 … … 24 24 #include <unistd.h> 25 25 #include <sys/mman.h> // mprotect 26 extern "C" { 27 // use this define to make unwind.h play nice, definitely a hack 28 #define HIDE_EXPORTS 26 29 #include <unwind.h> 30 #undef HIDE_EXPORTS 31 } 27 32 28 33 #include "kernel_private.hfa" 29 #include "exception.hfa"30 34 31 35 #define __CFA_INVOKE_PRIVATE__ … … 45 49 FORALL_DATA_INSTANCE(CoroutineCancelled, (dtype coroutine_t), (coroutine_t)) 46 50 51 struct __cfaehm_node { 52 struct _Unwind_Exception unwind_exception; 53 struct __cfaehm_node * next; 54 int handler_index; 55 }; 56 47 57 forall(dtype T) 48 58 void mark_exception(CoroutineCancelled(T) *) {} … … 50 60 forall(dtype T) 51 61 void copy(CoroutineCancelled(T) * dst, CoroutineCancelled(T) * src) { 52 dst->virtual_table = src->virtual_table;53 62 dst->the_coroutine = src->the_coroutine; 54 63 dst->the_exception = src->the_exception; … … 65 74 verify( desc->cancellation ); 66 75 desc->state = Cancelled; 67 exception_t * except = __cfaehm_cancellation_exception( desc->cancellation);76 exception_t * except = (exception_t *)(1 + (__cfaehm_node *)desc->cancellation); 68 77 69 78 // TODO: Remove explitate vtable set once trac#186 is fixed. … … 208 217 size = libFloor(create_size - stack_data_size - diff, libAlign()); 209 218 } // if 210 assertf( size >= MinStackSize, "Stack size %zd provides less than minimum of % zd bytes for a stack.", size, MinStackSize );219 assertf( size >= MinStackSize, "Stack size %zd provides less than minimum of %d bytes for a stack.", size, MinStackSize ); 211 220 212 221 this->storage = (__stack_t *)((intptr_t)storage + size);
Note:
See TracChangeset
for help on using the changeset viewer.