Re: [libvirt] [PATCH 1/13] Adding recursive locks

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

 




"Daniel P. Berrange" <berrange@xxxxxxxxxx> 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
--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]