summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorDavid Edmondson2021-03-25 12:29:38 +0100
committerStefan Hajnoczi2021-03-31 11:44:21 +0200
commit2f6ef0393b54383c204d4d6aa5b8eec2bcad566f (patch)
tree8460e490dd0f9bb4368c273eb02bd2f7d8ebe6c0 /util
parentblock/vdi: Don't assume that blocks are larger than VdiHeader (diff)
downloadqemu-2f6ef0393b54383c204d4d6aa5b8eec2bcad566f.tar.gz
qemu-2f6ef0393b54383c204d4d6aa5b8eec2bcad566f.tar.xz
qemu-2f6ef0393b54383c204d4d6aa5b8eec2bcad566f.zip
coroutine-lock: Store the coroutine in the CoWaitRecord only once
When taking the slow path for mutex acquisition, set the coroutine value in the CoWaitRecord in push_waiter(), rather than both there and in the caller. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: David Edmondson <david.edmondson@oracle.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 20210325112941.365238-4-pbonzini@redhat.com Message-Id: <20210309144015.557477-4-david.edmondson@oracle.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'util')
-rw-r--r--util/qemu-coroutine-lock.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c
index 5816bf8900..eb73cf11dc 100644
--- a/util/qemu-coroutine-lock.c
+++ b/util/qemu-coroutine-lock.c
@@ -204,7 +204,6 @@ static void coroutine_fn qemu_co_mutex_lock_slowpath(AioContext *ctx,
unsigned old_handoff;
trace_qemu_co_mutex_lock_entry(mutex, self);
- w.co = self;
push_waiter(mutex, &w);
/* This is the "Responsibility Hand-Off" protocol; a lock() picks from