static void fiber_start(unsigned int x, unsigned int y) { union cc_arg arg; ACL_FIBER *fiber; int i; arg.i[0] = x; arg.i[1] = y; fiber = (ACL_FIBER *) arg.p; #ifdef USE_JMP /* when using setjmp/longjmp, the context just be used only once */ if (fiber->context != NULL) { acl_myfree(fiber->context); fiber->context = NULL; } #endif fiber->fn(fiber, fiber->arg); for (i = 0; i < fiber->nlocal; i++) { if (fiber->locals[i]->free_fn) fiber->locals[i]->free_fn(fiber->locals[i]->ctx); } if (fiber->locals) { acl_myfree(fiber->locals); fiber->locals = NULL; fiber->nlocal = 0; } fiber_exit(0); }
void flexsc_exit(void *ret) { fiber_exit(__this->current, ret); }