mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-27 18:03:50 +03:00
nodedev: Signal initCond with driver locked
This is more academic dispute than a real bug, but this is taken from pthread_cond_broadcast(3p) man: The pthread_cond_broadcast() or pthread_cond_signal() functions may be called by a thread whether or not it currently owns the mutex that threads calling pthread_cond_wait() or pthread_cond_timedwait() have associated with the condition variable during their waits; however, if predictable scheduling behavior is required, then that mutex shall be locked by the thread calling pthread_cond_broadcast() or pthread_cond_signal(). Therefore, broadcast the initCond while the nodedev driver is still locked. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
72e3fc595e
commit
5b56a288ca
@ -1984,8 +1984,8 @@ nodeStateInitializeEnumerate(void *opaque)
|
||||
|
||||
nodeDeviceLock();
|
||||
driver->initialized = true;
|
||||
nodeDeviceUnlock();
|
||||
virCondBroadcast(&driver->initCond);
|
||||
nodeDeviceUnlock();
|
||||
|
||||
return;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user