From 6e44bb74f75382d143f0b530b990f9c710165087 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 4 Jun 2025 21:56:25 +0200 Subject: [PATCH] virthread: Register auto cleanup function for virMutex MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ján Tomko --- 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.47.3