]> git.sesse.net Git - vlc/blobdiff - include/vlc_threads.h
Cleanup helper for unlocking
[vlc] / include / vlc_threads.h
index e044e56d0a9ee625ca96f035580abe68de4a8fc0..c6be0eacddb1e3f8db17d66149b309e01c37e5b1 100644 (file)
@@ -373,6 +373,12 @@ struct vlc_cleanup_t
 
 #endif /* LIBVLC_USE_PTHREAD */
 
+static inline void vlc_cleanup_lock (void *lock)
+{
+    vlc_mutex_unlock ((vlc_mutex_t *)lock);
+}
+#define mutex_cleanup_push( lock ) vlc_cleanup_push (vlc_cleanup_lock, lock)
+
 /*****************************************************************************
  * vlc_cond_init: initialize a condition
  *****************************************************************************/