mirror of https://gitee.com/openkylin/libvirt.git
Simplify some redundant locking while unref'ing objects
There is no need to hold the mutex when unref'ing virObject instances Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
dd0371764f
commit
7307c3c00c
|
@ -741,9 +741,7 @@ static void
|
|||
virDomainObjListDataFree(void *payload, const void *name ATTRIBUTE_UNUSED)
|
||||
{
|
||||
virDomainObjPtr obj = payload;
|
||||
virDomainObjLock(obj);
|
||||
if (virObjectUnref(obj))
|
||||
virDomainObjUnlock(obj);
|
||||
virObjectUnref(obj);
|
||||
}
|
||||
|
||||
int virDomainObjListInit(virDomainObjListPtr doms)
|
||||
|
|
|
@ -3556,8 +3556,8 @@ endjob:
|
|||
ignore_value(qemuDomainObjEndAsyncJob(driver, wdEvent->vm));
|
||||
|
||||
unlock:
|
||||
if (virObjectUnref(wdEvent->vm))
|
||||
virDomainObjUnlock(wdEvent->vm);
|
||||
virDomainObjUnlock(wdEvent->vm);
|
||||
virObjectUnref(wdEvent->vm);
|
||||
qemuDriverUnlock(driver);
|
||||
VIR_FREE(wdEvent);
|
||||
}
|
||||
|
|
|
@ -191,10 +191,7 @@ static void virNetServerHandleJob(void *jobOpaque, void *opaque)
|
|||
if (virNetServerProcessMsg(srv, job->client, job->prog, job->msg) < 0)
|
||||
goto error;
|
||||
|
||||
virNetServerLock(srv);
|
||||
virObjectUnref(job->prog);
|
||||
virNetServerUnlock(srv);
|
||||
|
||||
virObjectUnref(job->client);
|
||||
VIR_FREE(job);
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue