mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -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
|
@ -122,6 +122,7 @@ void qemu_coroutine_enter(Coroutine *co)
|
|||
case COROUTINE_YIELD:
|
||||
return;
|
||||
case COROUTINE_TERMINATE:
|
||||
assert(!co->locks_held);
|
||||
trace_qemu_coroutine_terminate(co);
|
||||
coroutine_delete(co);
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue