mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-28 16:45:26 +00:00
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>
(cherry picked from commit 7307c3c00c
)
This commit is contained in:
parent
c9791620a0
commit
f4e3a2afa5
@ -741,9 +741,7 @@ static void
|
|||||||
virDomainObjListDataFree(void *payload, const void *name ATTRIBUTE_UNUSED)
|
virDomainObjListDataFree(void *payload, const void *name ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
virDomainObjPtr obj = payload;
|
virDomainObjPtr obj = payload;
|
||||||
virDomainObjLock(obj);
|
virObjectUnref(obj);
|
||||||
if (virObjectUnref(obj))
|
|
||||||
virDomainObjUnlock(obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int virDomainObjListInit(virDomainObjListPtr doms)
|
int virDomainObjListInit(virDomainObjListPtr doms)
|
||||||
|
@ -3499,8 +3499,8 @@ endjob:
|
|||||||
ignore_value(qemuDomainObjEndAsyncJob(driver, wdEvent->vm));
|
ignore_value(qemuDomainObjEndAsyncJob(driver, wdEvent->vm));
|
||||||
|
|
||||||
unlock:
|
unlock:
|
||||||
if (virObjectUnref(wdEvent->vm))
|
virDomainObjUnlock(wdEvent->vm);
|
||||||
virDomainObjUnlock(wdEvent->vm);
|
virObjectUnref(wdEvent->vm);
|
||||||
qemuDriverUnlock(driver);
|
qemuDriverUnlock(driver);
|
||||||
VIR_FREE(wdEvent);
|
VIR_FREE(wdEvent);
|
||||||
}
|
}
|
||||||
|
@ -191,10 +191,7 @@ static void virNetServerHandleJob(void *jobOpaque, void *opaque)
|
|||||||
if (virNetServerProcessMsg(srv, job->client, job->prog, job->msg) < 0)
|
if (virNetServerProcessMsg(srv, job->client, job->prog, job->msg) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
virNetServerLock(srv);
|
|
||||||
virObjectUnref(job->prog);
|
virObjectUnref(job->prog);
|
||||||
virNetServerUnlock(srv);
|
|
||||||
|
|
||||||
virObjectUnref(job->client);
|
virObjectUnref(job->client);
|
||||||
VIR_FREE(job);
|
VIR_FREE(job);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user