From fc6fde22c34ac9ae39f16494238140ba40456efd Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Wed, 7 Dec 2016 16:55:35 +1100 Subject: avutil/thread: Add pthread_cond_timedwait function v2: fix calculating milisecond times and use SleepConditionVariableSRW. Signed-off-by: Matt Oliver --- libavutil/thread.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libavutil') diff --git a/libavutil/thread.h b/libavutil/thread.h index cc5272d379..65b97ef303 100644 --- a/libavutil/thread.h +++ b/libavutil/thread.h @@ -109,6 +109,12 @@ static inline int strict_pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t ASSERT_PTHREAD(pthread_cond_wait, cond, mutex); } +static inline int strict_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, + const struct timespec *abstime) +{ + ASSERT_PTHREAD(pthread_cond_timedwait, cond, mutex, abstime); +} + static inline int strict_pthread_once(pthread_once_t *once_control, void (*init_routine)(void)) { ASSERT_PTHREAD(pthread_once, once_control, init_routine); @@ -124,6 +130,7 @@ static inline int strict_pthread_once(pthread_once_t *once_control, void (*init_ #define pthread_cond_signal strict_pthread_cond_signal #define pthread_cond_broadcast strict_pthread_cond_broadcast #define pthread_cond_wait strict_pthread_cond_wait +#define pthread_cond_timedwait strict_pthread_cond_timedwait #define pthread_once strict_pthread_once #endif -- cgit v1.2.3