mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 20: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
|
@ -459,17 +459,16 @@ void timer_mod_anticipate_ns(QEMUTimer *ts, int64_t expire_time)
|
|||
QEMUTimerList *timer_list = ts->timer_list;
|
||||
bool rearm;
|
||||
|
||||
qemu_mutex_lock(&timer_list->active_timers_lock);
|
||||
if (ts->expire_time == -1 || ts->expire_time > expire_time) {
|
||||
if (ts->expire_time != -1) {
|
||||
timer_del_locked(timer_list, ts);
|
||||
WITH_QEMU_LOCK_GUARD(&timer_list->active_timers_lock) {
|
||||
if (ts->expire_time == -1 || ts->expire_time > expire_time) {
|
||||
if (ts->expire_time != -1) {
|
||||
timer_del_locked(timer_list, ts);
|
||||
}
|
||||
rearm = timer_mod_ns_locked(timer_list, ts, expire_time);
|
||||
} else {
|
||||
rearm = false;
|
||||
}
|
||||
rearm = timer_mod_ns_locked(timer_list, ts, expire_time);
|
||||
} else {
|
||||
rearm = false;
|
||||
}
|
||||
qemu_mutex_unlock(&timer_list->active_timers_lock);
|
||||
|
||||
if (rearm) {
|
||||
timerlist_rearm(timer_list);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue