本文整理汇总了C++中Coroutine::entry方法的典型用法代码示例。如果您正苦于以下问题:C++ Coroutine::entry方法的具体用法?C++ Coroutine::entry怎么用?C++ Coroutine::entry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Coroutine
的用法示例。
在下文中一共展示了Coroutine::entry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
static void CALLBACK coroutine_trampoline(void *co_)
{
Coroutine *co = co_;
while (true) {
co->entry(co->entry_arg);
qemu_coroutine_switch(co, co->caller, COROUTINE_TERMINATE);
}
}
示例2: coroutine_trampoline
static void coroutine_trampoline(int i0, int i1)
{
union cc_arg arg;
CoroutineUContext *self;
Coroutine *co;
arg.i[0] = i0;
arg.i[1] = i1;
self = arg.p;
co = &self->base;
/* Initialize longjmp environment and switch back the caller */
if (!sigsetjmp(self->env, 0)) {
siglongjmp(*(sigjmp_buf *)co->entry_arg, 1);
}
while (true) {
co->entry(co->entry_arg);
qemu_coroutine_switch(co, co->caller, COROUTINE_TERMINATE);
}
}
示例3: setupEntry
void Coroutine::setupEntry()
{
Coroutine *current = (Coroutine *)sys().getContextOfCoroutine(sys().activeCoroutine());
current->entry();
}