coroutine: add qemu_coroutine_entered() function

See the doc comments for a description of this new coroutine API.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 1474989516-18255-2-git-send-email-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Stefan Hajnoczi 2016-09-27 16:18:34 +01:00
parent 844c82296f
commit f643e469f3
2 changed files with 18 additions and 0 deletions

View file

@ -146,3 +146,8 @@ void coroutine_fn qemu_coroutine_yield(void)
self->caller = NULL;
qemu_coroutine_switch(self, to, COROUTINE_YIELD);
}
bool qemu_coroutine_entered(Coroutine *co)
{
return co->caller;
}