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

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



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.