Am 09.11.2020 um 16:43 hat Gan Qixin geschrieben: > Replace manual lock()/unlock() calls with lock guard macros > (QEMU_LOCK_GUARD/WITH_QEMU_LOCK_GUARD) in block/throttle-groups.c. > > Signed-off-by: Gan Qixin <ganqi...@huawei.com>
> @@ -638,14 +636,14 @@ void > throttle_group_detach_aio_context(ThrottleGroupMember *tgm) > assert(qemu_co_queue_empty(&tgm->throttled_reqs[1])); > > /* Kick off next ThrottleGroupMember, if necessary */ > - qemu_mutex_lock(&tg->lock); > - for (i = 0; i < 2; i++) { > - if (timer_pending(tt->timers[i])) { > - tg->any_timer_armed[i] = false; > - schedule_next_request(tgm, i); > + WITH_QEMU_LOCK_GUARD(&tg->lock) { Indentation is off. > + for (i = 0; i < 2; i++) { > + if (timer_pending(tt->timers[i])) { > + tg->any_timer_armed[i] = false; > + schedule_next_request(tgm, i); > + } > } > } > - qemu_mutex_unlock(&tg->lock); > > throttle_timers_detach_aio_context(tt); > tgm->aio_context = NULL; Kevin