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 Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH RFC v2 09/13] libxl: introduce lock in libxl_ctx
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Thu, 3 Nov 2011 04:54:16 +0900
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 02 Nov 2011 12:55:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20145.29219.355664.444870@xxxxxxxxxxxxxxxxxxxxxxxx>
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>
Organization: Citrix Systems, Inc.
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> <20145.29219.355664.444870@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Wed, 2011-11-02 at 12:38 -0400, Ian Jackson wrote:
> 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.

OK, thanks.

I just had a read of pthread_mutex(3) and I'm surprised how many hoops
one has to jump through to use pthread_mutex_init(). Well, I say
surprised...

Ian.


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

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