Esempio n. 1
0
static void co_runner(void) {
	coroutine *co = co_curr;

	co->restarget = co->caller;
	co->func(co->data);
	co_exit();
}
Esempio n. 2
0
static void co_runner(void)
{
	cothread_ctx *tctx = co_get_thread_ctx();
	coroutine *co = tctx->co_curr;

	co->restarget = co->caller;
	co->func(co->data);
	co_exit();
}
Esempio n. 3
0
static void eph_exit_conn(struct eph_conn *conn)
{
	struct epoll_event ev;

	if (epoll_ctl(kdpfd, EPOLL_CTL_DEL, conn->sfd, &ev) < 0) {
		fprintf(stderr, "epoll set deletion error: fd=%d\n", conn->sfd);

	}

	DBL_LIST_DEL(&conn->lnk);
	DBL_LIST_ADDT(&conn->lnk, &close_list);

	eph_close(conn->sfd);
	conn->sfd = -1;

	--numfds;

	co_exit();
}