[libvirt PATCH 08/11] virChrdevFree: Use virLockGuard

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

 



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

diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c
index 8ca1c1062c..a95b8976ac 100644
--- a/src/conf/virchrdev.c
+++ b/src/conf/virchrdev.c
@@ -291,10 +291,10 @@ void virChrdevFree(virChrdevs *devs)
     if (!devs)
         return;
 
-    virMutexLock(&devs->lock);
-    virHashForEachSafe(devs->hash, virChrdevFreeClearCallbacks, NULL);
-    virHashFree(devs->hash);
-    virMutexUnlock(&devs->lock);
+    WITH_VIR_MUTEX_LOCK_GUARD(&devs->lock) {
+        virHashForEachSafe(devs->hash, virChrdevFreeClearCallbacks, NULL);
+        virHashFree(devs->hash);
+    }
     virMutexDestroy(&devs->lock);
 
     g_free(devs);
-- 
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