[libvirt] [PATCH 1/13] Adding recursive locks
Stefan Berger
stefanb at us.ibm.com
Wed Mar 17 12:31:00 UTC 2010
"Daniel P. Berrange" <berrange at redhat.com> wrote on 03/17/2010 07:48:46
AM:
Berrange"
> > void virMutexDestroy(virMutexPtr m)
> > {
> > pthread_mutex_destroy(&m->lock);
>
> Minor point, I think it would be better to call it
virMutexInitRecursive()
> so we keep the standard virMutex prefix for naming convention
>
Ok. Done.
>
> > Index: libvirt-acl/src/util/threads-pthread.h
> > ===================================================================
> > --- libvirt-acl.orig/src/util/threads-pthread.h
> > +++ libvirt-acl/src/util/threads-pthread.h
> > @@ -24,6 +24,7 @@
> > #include <pthread.h>
> >
> > struct virMutex {
> > + pthread_mutexattr_t attr;
> > pthread_mutex_t lock;
> > };
>
> I don't think this is neccessary - the attributes are only used
> at time of pthread_mutex_init() call, so don't need to be kept
> around after that. Thus the 'pthread_mutexattr_t attr' could just
> be a local variable in virRecursiveMutexInit().
Ok.
Thanks for reviewing.
Regards,
Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100317/0c4f6e95/attachment-0001.htm>
More information about the libvir-list
mailing list