- File:
-
- 1 edited
-
libcfa/src/concurrency/coroutine.cfa (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/coroutine.cfa
rfd54fef r5456537 46 46 47 47 //----------------------------------------------------------------------------- 48 FORALL_DATA_INSTANCE(CoroutineCancelled, (coroutine_t &), (coroutine_t))49 50 forall(T &)51 void mark_exception(CoroutineCancelled(T) *) {}52 53 48 forall(T &) 54 49 void copy(CoroutineCancelled(T) * dst, CoroutineCancelled(T) * src) { … … 65 60 // This code should not be inlined. It is the error path on resume. 66 61 forall(T & | is_coroutine(T)) 67 void __cfaehm_cancelled_coroutine( T & cor, $coroutine * desc ) { 62 void __cfaehm_cancelled_coroutine( 63 T & cor, $coroutine * desc, EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)) ) { 68 64 verify( desc->cancellation ); 69 65 desc->state = Cancelled; … … 72 68 // TODO: Remove explitate vtable set once trac#186 is fixed. 73 69 CoroutineCancelled(T) except; 74 except.virtual_table = & get_exception_vtable(&except);70 except.virtual_table = &_default_vtable; 75 71 except.the_coroutine = &cor; 76 72 except.the_exception = except; 77 throwResume except; 73 // Why does this need a cast? 74 throwResume (CoroutineCancelled(T) &)except; 78 75 79 76 except->virtual_table->free( except ); … … 148 145 // Part of the Public API 149 146 // Not inline since only ever called once per coroutine 150 forall(T & | is_coroutine(T) )147 forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)); }) 151 148 void prime(T& cor) { 152 149 $coroutine* this = get_coroutine(cor); … … 196 193 197 194 void __stack_clean ( __stack_info_t * this ) { 198 size_t size = ((intptr_t)this->storage->base) - ((intptr_t)this->storage->limit) + sizeof(__stack_t);199 195 void * storage = this->storage->limit; 200 196 201 197 #if CFA_COROUTINE_USE_MMAP 198 size_t size = ((intptr_t)this->storage->base) - ((intptr_t)this->storage->limit) + sizeof(__stack_t); 202 199 storage = (void *)(((intptr_t)storage) - __page_size); 203 200 if(munmap(storage, size + __page_size) == -1) {
Note:
See TracChangeset
for help on using the changeset viewer.