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

Rémi Denis-Courmont remi at remlab.net
Fri Feb 7 16:38:54 CET 2020


Hi,

I'm splitting up threads.c so that won't work.

Le 7 février 2020 17:02:09 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    | 17 ++++++++++++++++-
> 2 files changed, 16 insertions(+), 11 deletions(-)
>
>diff --git a/include/vlc_threads.h b/include/vlc_threads.h
>index 7ae25931b72..a5425236b1c 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 87c3da03d9e..7699cfae05d 100644
>--- a/src/misc/threads.c
>+++ b/src/misc/threads.c
>@@ -149,11 +149,26 @@ 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(atomic_int *addr)
>+{
>+    vlc_control_cancel(VLC_CANCEL_ADDR_SET, addr);
>+}
>+
>+static inline void vlc_cancel_addr_clear(atomic_int *addr)
>+{
>+    vlc_control_cancel(VLC_CANCEL_ADDR_CLEAR, addr);
>+}
>+
>+static void do_vlc_cancel_addr_clear(void *addr)
>+{
>+    vlc_cancel_addr_clear(addr);
>+}
>+
> static void vlc_cancel_addr_prepare(atomic_int *addr)
> {
>    /* Let thread subsystem on address to broadcast for cancellation */
>     vlc_cancel_addr_set(addr);
>-    vlc_cleanup_push(vlc_cancel_addr_clear, addr);
>+    vlc_cleanup_push(do_vlc_cancel_addr_clear, addr);
>   /* Check if cancellation was pending before vlc_cancel_addr_set() */
>     vlc_testcancel();
>     vlc_cleanup_pop();
>-- 
>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/20200207/f75a6808/attachment.html>


More information about the vlc-devel mailing list