diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/pulp.c | 23 |
1 files changed, 3 insertions, 20 deletions
@@ -162,15 +162,6 @@ static inline void set_current_fiber(pulp_t *pulp, list_head_t *head) #ifdef __WIN32__ -/* sets the supplied context as the executing context */ -static void enter_context(pulp_context_t *context) -{ - assert(context); - - SwitchToFiber(context->win32_fiber); -} - - /* win32 fibers can't return or the program exits, so their functions need to * run from a trampoline function, and there's only one pointer supplied so now * I need the fiber's thunk saved in the fiber structure, and I find the fiber @@ -187,7 +178,8 @@ static void win32_trampoline(void *ptr) assert(pulp->current->thunk); (void) thunk_dispatch(pulp->current->thunk); - enter_context(&pulp->trampoline_context); + + SwitchToFiber(pulp->trampoline_context.win32_fiber); } @@ -217,7 +209,7 @@ static void swap_context(pulp_context_t *old, pulp_context_t *new) if (old == new) return; - enter_context(new); + SwitchToFiber(new->win32_fiber); } @@ -246,15 +238,6 @@ static void setup_context(pulp_t *pulp, pulp_context_t *context, void *func, voi } -/* sets the supplied context as the executing context */ -static void enter_context(pulp_context_t *context) -{ - assert(context); - - setcontext(&context->ucontext); -} - - /* swaps the new supplied context with the executing context */ /* the current context is saved in old */ static void swap_context(pulp_context_t *old, pulp_context_t *new) |