"Daniel P. Berrange" <berrange@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