[Spice-devel] [PATCH] reduce locking time in async_command_alloc

Christophe Fergeau cfergeau at redhat.com
Fri Oct 23 02:52:49 PDT 2015


Why not, ACK.

On Wed, Oct 14, 2015 at 04:32:54PM +0100, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/red_dispatcher.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/server/red_dispatcher.c b/server/red_dispatcher.c
> index b11cd42..660dad8 100644
> --- a/server/red_dispatcher.c
> +++ b/server/red_dispatcher.c
> @@ -336,9 +336,10 @@ static AsyncCommand *async_command_alloc(RedDispatcher *dispatcher,
>  {
>      AsyncCommand *async_command = spice_new0(AsyncCommand, 1);
>  
> -    pthread_mutex_lock(&dispatcher->async_lock);
>      async_command->cookie = cookie;
>      async_command->message = message;
> +
> +    pthread_mutex_lock(&dispatcher->async_lock);
>      ring_add(&dispatcher->async_commands, &async_command->link);
>      pthread_mutex_unlock(&dispatcher->async_lock);
>      spice_debug("%p", async_command);
> -- 
> 2.4.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20151023/9e3d34ae/attachment.sig>


More information about the Spice-devel mailing list