[libvirt PATCH v2 09/12] virChrdevFDStreamCloseCb: Use virLockGuardNew

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

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/conf/virchrdev.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c
index 5d6de68427..fe11e10437 100644
--- a/src/conf/virchrdev.c
+++ b/src/conf/virchrdev.c
@@ -237,12 +237,10 @@ static void virChrdevFDStreamCloseCb(virStreamPtr st G_GNUC_UNUSED,
                                       void *opaque)
 {
     virChrdevStreamInfo *priv = opaque;
-    virMutexLock(&priv->devs->lock);
+    g_autoptr(virLockGuard) lock = virLockGuardNew(&priv->devs->lock);
 
     /* remove entry from hash */
     virHashRemoveEntry(priv->devs->hash, priv->path);
-
-    virMutexUnlock(&priv->devs->lock);
 }
 
 /**
-- 
2.31.1




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

  Powered by Linux