Re: [PATCH 2/2] Lock the whole virConnect Object when disposing to avoid the thread race

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

 



On Wed, Dec 05, 2012 at 10:48:44PM +0800, Osier Yang wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=866524
> 
> Since the virConnect object is not locked wholely when doing
> virConenctDispose, a thread can get the lock and thus might
> cause the race.


> This patch is to fix it by locking the whole virConnect object when
> disposing it.

No, this is wrong. If two threads are using an object, they
must each be holding a reference on the object. virConnectDispose
is the *last* thing to happen to an object. If a 2nd thread is
still using an object when virConnectDipose runs, then by definition,
it has forgotten to hold a reference count. Locking cannot save you
at this point - the 2nd thread will end up waiting on a mutex that
has been destroyed

NACK

Daniel

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