WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH RFC v2 09/13] libxl: introduce lock in libxl_ctx

To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH RFC v2 09/13] libxl: introduce lock in libxl_ctx
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Wed, 2 Nov 2011 16:38:59 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 02 Nov 2011 09:39:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1320055382.23193.38.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1319827031-15395-1-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1319827031-15395-2-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1319827031-15395-3-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1319827031-15395-4-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1319827031-15395-5-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1319827031-15395-6-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1319827031-15395-7-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1319827031-15395-8-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1319827031-15395-9-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1319827031-15395-10-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1320055382.23193.38.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Ian Campbell writes ("Re: [Xen-devel] [PATCH RFC v2 09/13] libxl: introduce 
lock in libxl_ctx"):
> On Fri, 2011-10-28 at 19:37 +0100, Ian Jackson wrote:
> > +    const pthread_mutex_t mutex_value = 
> > PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
...
> > +    memcpy(&ctx->lock, &mutex_value, sizeof(ctx->lock));
> 
> Is this subtly different to
>        ctx->lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
> in some way I'm missing?

Yes.  PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is formally valid only as
an initialiser, not necessarily as an expression.  I'm not sure that
relevant GCC extensions mean the two are always equivalent.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>