qemu_co_rwlock_wrlock stores the current coroutine in a loc variable, use it instead of calling qemu_coroutine_self() again.
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- util/qemu-coroutine-lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c index 2669403839..490fb32891 100644 --- a/util/qemu-coroutine-lock.c +++ b/util/qemu-coroutine-lock.c @@ -436,7 +436,7 @@ void qemu_co_rwlock_wrlock(CoRwlock *lock) lock->owners = -1; qemu_co_mutex_unlock(&lock->mutex); } else { - CoRwTicket my_ticket = { false, qemu_coroutine_self() }; + CoRwTicket my_ticket = { false, self }; QSIMPLEQ_INSERT_TAIL(&lock->tickets, &my_ticket, next); qemu_co_mutex_unlock(&lock->mutex); -- 2.35.1