From: Peter Krempa <pkre...@redhat.com>

This makes it very convenient to declare a mutex on stack along with the
VIR_MUTEX_INITIALIZE macro without the need to have complex cleanup.

Signed-off-by: Peter Krempa <pkre...@redhat.com>
---
 src/util/virthread.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/util/virthread.h b/src/util/virthread.h
index 23abe0b6c9..a7ec6bf32c 100644
--- a/src/util/virthread.h
+++ b/src/util/virthread.h
@@ -121,6 +121,7 @@ int virOnce(virOnceControl *once, virOnceFunc init)
 int virMutexInit(virMutex *m) G_GNUC_WARN_UNUSED_RESULT;
 int virMutexInitRecursive(virMutex *m) G_GNUC_WARN_UNUSED_RESULT;
 void virMutexDestroy(virMutex *m);
+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virMutex, virMutexDestroy);

 void virMutexLock(virMutex *m);
 void virMutexUnlock(virMutex *m);
-- 
2.49.0

Reply via email to