mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
coroutine: Assert that no locks are held on termination
A coroutine that takes a lock must also release it again. If the coroutine terminates without having released all its locks, it's buggy and we'll probably run into a deadlock sooner or later. Make sure that we don't get such cases. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
0e438cdc93
commit
1b7f01d966
3 changed files with 13 additions and 0 deletions
|
@ -39,6 +39,7 @@ struct Coroutine {
|
|||
void *entry_arg;
|
||||
Coroutine *caller;
|
||||
QSLIST_ENTRY(Coroutine) pool_next;
|
||||
size_t locks_held;
|
||||
|
||||
/* Coroutines that should be woken up when we yield or terminate */
|
||||
QSIMPLEQ_HEAD(, Coroutine) co_queue_wakeup;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue