Ignore:
File:
1 edited

Legend:

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

    r290553a rc960331  
    1010// Created On       : Mon Nov 28 12:27:26 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue May 26 22:06:09 2020
    13 // Update Count     : 21
     12// Last Modified On : Fri Oct 23 23:05:24 2020
     13// Update Count     : 22
    1414//
    1515
     
    2424#include <unistd.h>
    2525#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
    2926#include <unwind.h>
    30 #undef HIDE_EXPORTS
    31 }
    3227
    3328#include "kernel_private.hfa"
     29#include "exception.hfa"
    3430
    3531#define __CFA_INVOKE_PRIVATE__
     
    4945FORALL_DATA_INSTANCE(CoroutineCancelled, (dtype coroutine_t), (coroutine_t))
    5046
    51 struct __cfaehm_node {
    52         struct _Unwind_Exception unwind_exception;
    53         struct __cfaehm_node * next;
    54         int handler_index;
    55 };
    56 
    5747forall(dtype T)
    5848void mark_exception(CoroutineCancelled(T) *) {}
     
    6050forall(dtype T)
    6151void copy(CoroutineCancelled(T) * dst, CoroutineCancelled(T) * src) {
     52        dst->virtual_table = src->virtual_table;
    6253        dst->the_coroutine = src->the_coroutine;
    6354        dst->the_exception = src->the_exception;
     
    7465        verify( desc->cancellation );
    7566        desc->state = Cancelled;
    76         exception_t * except = (exception_t *)(1 + (__cfaehm_node *)desc->cancellation);
     67        exception_t * except = __cfaehm_cancellation_exception( desc->cancellation );
    7768
    7869        // TODO: Remove explitate vtable set once trac#186 is fixed.
     
    217208                size = libFloor(create_size - stack_data_size - diff, libAlign());
    218209        } // if
    219         assertf( size >= MinStackSize, "Stack size %zd provides less than minimum of %d bytes for a stack.", size, MinStackSize );
     210        assertf( size >= MinStackSize, "Stack size %zd provides less than minimum of %zd bytes for a stack.", size, MinStackSize );
    220211
    221212        this->storage = (__stack_t *)((intptr_t)storage + size);
Note: See TracChangeset for help on using the changeset viewer.