[vlc-devel] [PATCH v2 7/8] threads: remove vlc_clone_detach()

Romain Vimont rom1v at videolabs.io
Sun Sep 13 21:11:20 CEST 2020


It had been deprecated by c5f960ff25baddc2e697adefd98a9741ee40d5fc, and
is not used anymore.
---
 src/libvlc.h       |  3 ---
 src/os2/thread.c   | 10 ----------
 src/posix/thread.c | 35 -----------------------------------
 src/win32/thread.c | 10 ----------
 4 files changed, 58 deletions(-)

diff --git a/src/libvlc.h b/src/libvlc.h
index 884af326a3..9a4fd94689 100644
--- a/src/libvlc.h
+++ b/src/libvlc.h
@@ -44,9 +44,6 @@ void vlc_CPU_dump(vlc_object_t *);
  * Threads subsystem
  */
 
-VLC_DEPRECATED
-int vlc_clone_detach (vlc_thread_t *, void *(*)(void *), void *, int);
-
 int vlc_set_priority( vlc_thread_t, int );
 
 void vlc_threads_setup (libvlc_int_t *);
diff --git a/src/os2/thread.c b/src/os2/thread.c
index a5fa6c8bda..c5557f12be 100644
--- a/src/os2/thread.c
+++ b/src/os2/thread.c
@@ -358,16 +358,6 @@ void vlc_join (vlc_thread_t th, void **result)
     free( th );
 }
 
-int vlc_clone_detach (vlc_thread_t *p_handle, void *(*entry) (void *),
-                      void *data, int priority)
-{
-    vlc_thread_t th;
-    if (p_handle == NULL)
-        p_handle = &th;
-
-    return vlc_clone_attr (p_handle, true, entry, data, priority);
-}
-
 int vlc_set_priority (vlc_thread_t th, int priority)
 {
     if (DosSetPriority(PRTYS_THREAD,
diff --git a/src/posix/thread.c b/src/posix/thread.c
index 33f6da47bc..91eab74716 100644
--- a/src/posix/thread.c
+++ b/src/posix/thread.c
@@ -227,41 +227,6 @@ void vlc_join(vlc_thread_t th, void **result)
     VLC_THREAD_ASSERT ("joining thread");
 }
 
-/**
- * Creates and starts new detached thread.
- *
- * A detached thread cannot be joined. Its resources will be automatically
- * released whenever the thread exits (in particular, its call stack will be
- * reclaimed).
- *
- * \warning
- * Detached thread are intrinsically unsafe to use, as there are no ways to
- * know whence the thread has terminated cleanly and its resources can be
- * reclaimed (in particular, the executable code run by the thread).
- *
- * \bug
- * This function should be removed. Do not use this function in new code.
- *
- * @param th [OUT] pointer to hold the thread handle, or NULL
- * @param entry entry point for the thread
- * @param data data parameter given to the entry point
- * @param priority thread priority value
- * @return 0 on success, a standard error code on error.
- */
-int vlc_clone_detach (vlc_thread_t *th, void *(*entry) (void *), void *data,
-                      int priority)
-{
-    vlc_thread_t dummy;
-    pthread_attr_t attr;
-
-    if (th == NULL)
-        th = &dummy;
-
-    pthread_attr_init (&attr);
-    pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
-    return vlc_clone_attr (th, &attr, entry, data, priority);
-}
-
 VLC_WEAK unsigned long vlc_thread_id(void)
 {
      return -1;
diff --git a/src/win32/thread.c b/src/win32/thread.c
index 255946913c..3879b46388 100644
--- a/src/win32/thread.c
+++ b/src/win32/thread.c
@@ -436,16 +436,6 @@ void vlc_join (vlc_thread_t th, void **result)
     vlc_thread_destroy(th);
 }
 
-int vlc_clone_detach (vlc_thread_t *p_handle, void *(*entry) (void *),
-                      void *data, int priority)
-{
-    vlc_thread_t th;
-    if (p_handle == NULL)
-        p_handle = &th;
-
-    return vlc_clone_attr (p_handle, true, entry, data, priority);
-}
-
 unsigned long vlc_thread_id (void)
 {
     return GetCurrentThreadId ();
-- 
2.28.0



More information about the vlc-devel mailing list