mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
lockable: replaced locks with lock guard macros where appropriate
- ran regexp "qemu_mutex_lock\(.*\).*\n.*if" to find targets - replaced result with QEMU_LOCK_GUARD if all unlocks at function end - replaced result with WITH_QEMU_LOCK_GUARD if unlock not at end Signed-off-by: Daniel Brodsky <dnbrdsky@gmail.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-id: 20200404042108.389635-3-dnbrdsky@gmail.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
56f21718b8
commit
6e8a355de6
15 changed files with 83 additions and 106 deletions
|
@ -1369,7 +1369,7 @@ static RAMBlock *unqueue_page(RAMState *rs, ram_addr_t *offset)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
qemu_mutex_lock(&rs->src_page_req_mutex);
|
||||
QEMU_LOCK_GUARD(&rs->src_page_req_mutex);
|
||||
if (!QSIMPLEQ_EMPTY(&rs->src_page_requests)) {
|
||||
struct RAMSrcPageRequest *entry =
|
||||
QSIMPLEQ_FIRST(&rs->src_page_requests);
|
||||
|
@ -1386,7 +1386,6 @@ static RAMBlock *unqueue_page(RAMState *rs, ram_addr_t *offset)
|
|||
migration_consume_urgent_request();
|
||||
}
|
||||
}
|
||||
qemu_mutex_unlock(&rs->src_page_req_mutex);
|
||||
|
||||
return block;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue