qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 2/4] qemu-thread: introduce qemu-thread-commo


From: Emilio G. Cota
Subject: Re: [Qemu-devel] [PATCH v4 2/4] qemu-thread: introduce qemu-thread-common.h
Date: Mon, 23 Apr 2018 14:08:04 -0400
User-agent: Mutt/1.5.24 (2015-08-30)

On Mon, Apr 23, 2018 at 13:39:25 +0800, Peter Xu wrote:
> Introduce some hooks for the shared part of qemu thread between POSIX
> and Windows implementations.  Note that in qemu_mutex_unlock_impl() we
> moved the call before unlock operation which should make more sense.
> And we don't need qemu_mutex_post_unlock() hook.
> 
> Currently the hooks only calls the tracepoints.
> 
> Put all these shared hooks into the header files.  It should be internal
> to qemu-thread but not for qemu-thread users, hence put into util/
> directory.
> 
> Signed-off-by: Peter Xu <address@hidden>
> ---
(snip)
> @@ -92,11 +90,10 @@ void qemu_mutex_unlock_impl(QemuMutex *mutex, const char 
> *file, const int line)
>      int err;
>  
>      assert(mutex->initialized);
> +    qemu_mutex_pre_unlock(mutex, file, line);
>      err = pthread_mutex_unlock(&mutex->lock);
>      if (err)
>          error_exit(err, __func__);
> -
> -    trace_qemu_mutex_unlock(mutex, file, line);
>  }
(snip)
> @@ -81,7 +80,7 @@ int qemu_mutex_trylock_impl(QemuMutex *mutex, const char 
> *file, const int line)
>  void qemu_mutex_unlock_impl(QemuMutex *mutex, const char *file, const int 
> line)
>  {
>      assert(mutex->initialized);
> -    trace_qemu_mutex_unlock(mutex, file, line);
> +    qemu_mutex_pre_unlock(mutex, file, line);
>      ReleaseSRWLockExclusive(&mutex->lock);
>  }

Note that in posix we're moving the unlock tracepoint before the actual
unlock happens. But that makes it consistent with that we're doing in win32,
and AFAICT it seems a better place to do it, so:

Reviewed-by: Emilio G. Cota <address@hidden>

Thanks,

                E.



reply via email to

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