[vlc-devel] [PATCH 1/4] threads: move vlc_cancel_addr_set/clear in threads.c

Steve Lhomme robux4 at ycbcr.xyz
Mon Feb 10 10:02:19 CET 2020


It's only used there and this way we can use the proper type matching the
storage.
---
 include/vlc_threads.h | 10 ----------
 src/misc/threads.c    | 10 ++++++++++
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index 2e85d63d6be..341ee97271e 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -1100,16 +1100,6 @@ static inline void vlc_cleanup_lock (void *lock)
 }
 #define mutex_cleanup_push( lock ) vlc_cleanup_push (vlc_cleanup_lock, lock)
 
-static inline void vlc_cancel_addr_set(void *addr)
-{
-    vlc_control_cancel(VLC_CANCEL_ADDR_SET, addr);
-}
-
-static inline void vlc_cancel_addr_clear(void *addr)
-{
-    vlc_control_cancel(VLC_CANCEL_ADDR_CLEAR, addr);
-}
-
 #ifdef __cplusplus
 /**
  * Helper C++ class to lock a mutex.
diff --git a/src/misc/threads.c b/src/misc/threads.c
index 501a17ac9b3..e6b993c4408 100644
--- a/src/misc/threads.c
+++ b/src/misc/threads.c
@@ -149,6 +149,16 @@ bool vlc_mutex_marked(const vlc_mutex_t *mutex)
 #if defined(LIBVLC_NEED_SLEEP) || defined(LIBVLC_NEED_CONDVAR)
 #include <stdatomic.h>
 
+static inline void vlc_cancel_addr_set(void *addr)
+{
+    vlc_control_cancel(VLC_CANCEL_ADDR_SET, addr);
+}
+
+static inline void vlc_cancel_addr_clear(void *addr)
+{
+    vlc_control_cancel(VLC_CANCEL_ADDR_CLEAR, addr);
+}
+
 static void vlc_cancel_addr_prepare(void *addr)
 {
     /* Let thread subsystem on address to broadcast for cancellation */
-- 
2.17.1



More information about the vlc-devel mailing list