[Libvirt-cim] [PATCH V5 06/15] CSI, add lock to protect shared data in lifecycle_thread
John Ferlan
jferlan at redhat.com
Thu Mar 21 17:16:25 UTC 2013
On 03/20/2013 11:39 PM, Wenchao Xia wrote:
> This patch use lock 'lifecycle_mutex' to protect gloable shared
> data in lifecycle_thread(). This lock exist in Activate/Deactivate
> Enable/Disable method, which is meant to protect the gloable
s/gloable/global
> shared data, but forgot to be added in new libvirt based CSI
> thread.
> This patch can avoid following risk at least: Original code have
> a small chance to free thread->args in child thread just after main
> thread malloc it, for that thread->id is set to zero allowing main
> thread to enter that code.
> This patch focus on adding missing lock, the CSI can be still
> improved as: smaller lock, folder lock into a structure with data
> to tip better what it is doing.
>
> Signed-off-by: Wenchao Xia <xiawenc at linux.vnet.ibm.com>
> ---
> src/Virt_ComputerSystemIndication.c | 39 ++++++++++++++++++++++++++++++++--
> 1 files changed, 36 insertions(+), 3 deletions(-)
>
ACK
John
More information about the Libvirt-cim
mailing list