[vlc-devel] [PATCH] thread: remove vlc_cond_init_daytime()

RĂ©mi Denis-Courmont remi at remlab.net
Sat Feb 22 13:21:06 CET 2020


This has become identical to vlc_cond_init() on all platforms.
---
 include/vlc_threads.h | 22 ----------------------
 src/input/vlm.c       |  2 +-
 src/misc/threads.c    |  5 -----
 3 files changed, 1 insertion(+), 28 deletions(-)

diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index d04da93629..de9081fea4 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -432,12 +432,6 @@ typedef struct
 
 /**
  * Static initializer for (static) condition variable.
- *
- * \note
- * The condition variable will use the default clock, which is OS-dependent.
- * Therefore, where timed waits are necessary the condition variable should
- * always be initialized dynamically explicit instead of using this
- * initializer.
  */
 #define VLC_STATIC_COND { NULL, VLC_STATIC_MUTEX }
 
@@ -446,17 +440,6 @@ typedef struct
  */
 VLC_API void vlc_cond_init(vlc_cond_t *);
 
-/**
- * Initializes a condition variable (wall clock).
- *
- * This function initializes a condition variable for timed waiting using the
- * UTC wall clock time. The time reference is the same as with time() and with
- * timespec_get() and TIME_UTC.
- * vlc_cond_timedwait_daytime() must be instead of
- * vlc_cond_timedwait() for actual waiting.
- */
-void vlc_cond_init_daytime(vlc_cond_t *);
-
 /**
  * Wakes up one thread waiting on a condition variable.
  *
@@ -525,11 +508,6 @@ VLC_API void vlc_cond_wait(vlc_cond_t *cond, vlc_mutex_t *mutex);
  *              then locked again when waking up
  * \param deadline <b>absolute</b> timeout
  *
- * \warning If the variable was initialized with vlc_cond_init_daytime(), or
- * was statically initialized with \ref VLC_STATIC_COND, the time reference
- * used by this function is unspecified (depending on the implementation, it
- * might be the Unix epoch or the vlc_tick_now() clock).
- *
  * \return 0 if the condition was signaled, an error code in case of timeout.
  */
 VLC_API int vlc_cond_timedwait(vlc_cond_t *cond, vlc_mutex_t *mutex,
diff --git a/src/input/vlm.c b/src/input/vlm.c
index 852c91f492..88cb8e5cad 100644
--- a/src/input/vlm.c
+++ b/src/input/vlm.c
@@ -166,7 +166,7 @@ vlm_t *vlm_New( libvlc_int_t *libvlc, const char *psz_vlmconf )
 
     vlc_mutex_init( &p_vlm->lock );
     vlc_mutex_init( &p_vlm->lock_manage );
-    vlc_cond_init_daytime( &p_vlm->wait_manage );
+    vlc_cond_init( &p_vlm->wait_manage );
     p_vlm->users = 1;
     p_vlm->input_state_changed = false;
     p_vlm->exiting = false;
diff --git a/src/misc/threads.c b/src/misc/threads.c
index 2976b010c5..4a7ed0a200 100644
--- a/src/misc/threads.c
+++ b/src/misc/threads.c
@@ -228,11 +228,6 @@ void vlc_cond_init(vlc_cond_t *cond)
     vlc_mutex_init(&cond->lock);
 }
 
-void vlc_cond_init_daytime(vlc_cond_t *cond)
-{
-    vlc_cond_init(cond);
-}
-
 struct vlc_cond_waiter {
     struct vlc_cond_waiter **pprev, *next;
     atomic_uint value;
-- 
2.25.1



More information about the vlc-devel mailing list