qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/5] qemu-timer: convert to use lock guards


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 3/5] qemu-timer: convert to use lock guards
Date: Fri, 8 Dec 2017 14:26:44 +0000
User-agent: Mutt/1.9.1 (2017-09-22)

On Fri, Dec 08, 2017 at 11:55:51AM +0100, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
>  util/qemu-timer.c | 84 
> +++++++++++++++++++++++++++----------------------------
>  1 file changed, 42 insertions(+), 42 deletions(-)
> 
> diff --git a/util/qemu-timer.c b/util/qemu-timer.c
> index 82d56507a2..7a99e0e336 100644
> --- a/util/qemu-timer.c
> +++ b/util/qemu-timer.c
> @@ -192,14 +192,11 @@ bool timerlist_expired(QEMUTimerList *timer_list)
>          return false;
>      }
>  
> -    qemu_mutex_lock(&timer_list->active_timers_lock);
> +    QEMU_LOCK_GUARD(QemuMutex, timers_guard, 
> &timer_list->active_timers_lock);

It's not obvious to me that calling qemu_lock_get_ns() below with
active_timers_lock held is a good idea.  Using QEMU_WITH_LOCK() seems
like the clearer and safer option than QEMU_LOCK_GUARD().

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]