void co_call(coroutine_t coro) { coroutine *co = (coroutine *) coro, *oldco = co_curr; co->caller = co_curr; co_curr = co; co_switch_context(&oldco->ctx, &co->ctx); }
void co_call(coroutine_t coro) { cothread_ctx *tctx = co_get_thread_ctx(); coroutine *co = (coroutine *) coro, *oldco = tctx->co_curr; co->caller = tctx->co_curr; tctx->co_curr = co; co_switch_context(&oldco->ctx, &co->ctx); }