mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-01 20:42:19 +00:00
avutil/thread: add wrappers for pthread_cond_t functions
This abstraction is similar to the existing one for pthread_mutex_t and pthread_once_t functions, and should reduce the amount of ifdeffery used in future code. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
7e246a5db5
commit
8c789c5da3
@ -163,6 +163,15 @@ static inline int strict_pthread_once(pthread_once_t *once_control, void (*init_
|
||||
#define ff_mutex_unlock pthread_mutex_unlock
|
||||
#define ff_mutex_destroy pthread_mutex_destroy
|
||||
|
||||
#define AVCond pthread_cond_t
|
||||
|
||||
#define ff_cond_init pthread_cond_init
|
||||
#define ff_cond_destroy pthread_cond_destroy
|
||||
#define ff_cond_signal pthread_cond_signal
|
||||
#define ff_cond_broadcast pthread_cond_broadcast
|
||||
#define ff_cond_wait pthread_cond_wait
|
||||
#define ff_cond_timedwait pthread_cond_timedwait
|
||||
|
||||
#define AVOnce pthread_once_t
|
||||
#define AV_ONCE_INIT PTHREAD_ONCE_INIT
|
||||
|
||||
@ -178,6 +187,16 @@ static inline int ff_mutex_lock(AVMutex *mutex){ return 0; }
|
||||
static inline int ff_mutex_unlock(AVMutex *mutex){ return 0; }
|
||||
static inline int ff_mutex_destroy(AVMutex *mutex){ return 0; }
|
||||
|
||||
#define AVCond char
|
||||
|
||||
static inline int ff_cond_init(AVCond *cond, const void *attr){ return 0; }
|
||||
static inline int ff_cond_destroy(AVCond *cond){ return 0; }
|
||||
static inline int ff_cond_signal(AVCond *cond){ return 0; }
|
||||
static inline int ff_cond_broadcast(AVCond *cond){ return 0; }
|
||||
static inline int ff_cond_wait(AVCond *cond, AVMutex *mutex){ return 0; }
|
||||
static inline int ff_cond_timedwait(AVCond *cond, AVMutex *mutex,
|
||||
const void *abstime){ return 0; }
|
||||
|
||||
#define AVOnce char
|
||||
#define AV_ONCE_INIT 0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user