Exemple #1
0
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);
}
Exemple #2
0
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);
}