diff options
author | Matt Oliver <protogonoi@gmail.com> | 2016-12-07 16:55:35 +1100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2020-01-21 22:34:15 +0100 |
commit | fc6fde22c34ac9ae39f16494238140ba40456efd (patch) | |
tree | 3cdec30db06d618a115dddbd7cce2d8d72b097cb /libavutil/thread.h | |
parent | 00447b6f523e5b86bec6c3944ad917edea4ed50c (diff) | |
download | ffmpeg-fc6fde22c34ac9ae39f16494238140ba40456efd.tar.gz |
avutil/thread: Add pthread_cond_timedwait function
v2: fix calculating milisecond times and use SleepConditionVariableSRW.
Signed-off-by: Matt Oliver <protogonoi@gmail.com>
Diffstat (limited to 'libavutil/thread.h')
-rw-r--r-- | libavutil/thread.h | 7 |
1 files changed, 7 insertions, 0 deletions
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 |