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

Rémi Denis-Courmont remi at remlab.net
Mon Feb 10 11:54:12 CET 2020


'inline' is useless outside headers for static functions. As already noted, I'd rather we make these two proper private functions of the core.

Le 10 février 2020 11:02:19 GMT+02:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
>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
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20200210/48d04d2a/attachment.html>


More information about the vlc-devel mailing list