[PATCH v3 4/8] close callback API: remove unnecessary locks

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

 



closeCallback pointer is immutable (set on connection object creation)
and self-locking.
---
 src/libvirt-host.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/src/libvirt-host.c b/src/libvirt-host.c
index c492bd8..0bab5f2 100644
--- a/src/libvirt-host.c
+++ b/src/libvirt-host.c
@@ -1214,21 +1214,16 @@ virConnectRegisterCloseCallback(virConnectPtr conn,
     VIR_DEBUG("conn=%p", conn);
 
     virResetLastError();
-
     virCheckConnectReturn(conn, -1);
-    virObjectLock(conn);
-
     virCheckNonNullArgGoto(cb, error);
 
     if (virConnectCloseCallbackDataRegister(conn->closeCallback, conn, cb,
                                             opaque, freecb) < 0)
         goto error;
 
-    virObjectUnlock(conn);
     return 0;
 
  error:
-    virObjectUnlock(conn);
     virDispatchError(conn);
     return -1;
 }
@@ -1254,20 +1249,15 @@ virConnectUnregisterCloseCallback(virConnectPtr conn,
     VIR_DEBUG("conn=%p", conn);
 
     virResetLastError();
-
     virCheckConnectReturn(conn, -1);
-    virObjectLock(conn);
-
     virCheckNonNullArgGoto(cb, error);
 
     if (virConnectCloseCallbackDataUnregister(conn->closeCallback, cb) < 0)
         goto error;
 
-    virObjectUnlock(conn);
     return 0;
 
  error:
-    virObjectUnlock(conn);
     virDispatchError(conn);
     return -1;
 }
-- 
1.8.3.1

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