Re: [PATCH 3/4] vbox: change API (un)initialization logic.

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

 



On Tue, 2016-10-11 at 16:22 +0200, Martin Kletzander wrote:
> On Wed, Sep 28, 2016 at 01:41:35PM -0400, Dawid Zamirski wrote:
> > 
> > * _pfnUnitilalize decrements connectionCount in g_pVBoxGlobalData
> > and
> >  once it is down to 0, it calls pfnComUnitialize and
> >  g_pVBoxGlobalData if free'd. This ensures that pfnComInitialize
> > and
> >  pfnComUnitialize pair is called only once, even when multiple
> >  concurrent connections are in use.
> 
> That's not true if there is a connection being made while it is being
> free()d or it's being allocated in two threads, etc.  Unless I missed
> something, that is.

On a second thought, seeing how both _pfnInitialize and _pfnUnintialize
(each called in virConnectOpen/Close respectively) obtain a mutex on
g_pVBoxGlobalData, I think my original statement holds true, that is,
ignoring the unsafe allocation of the global as you pointed out
earlier.

--
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]