You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
Merge commit 'c53e796f8b69799b7ad6d28fbab981d37edf1bc9'
* commit 'c53e796f8b69799b7ad6d28fbab981d37edf1bc9': thread: Provide no-op variants for pthread_once Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
This commit is contained in:
@@ -43,6 +43,11 @@
|
|||||||
#define ff_mutex_unlock pthread_mutex_unlock
|
#define ff_mutex_unlock pthread_mutex_unlock
|
||||||
#define ff_mutex_destroy pthread_mutex_destroy
|
#define ff_mutex_destroy pthread_mutex_destroy
|
||||||
|
|
||||||
|
#define AVOnce pthread_once_t
|
||||||
|
#define AV_ONCE_INIT PTHREAD_ONCE_INIT
|
||||||
|
|
||||||
|
#define ff_thread_once(control, routine) pthread_once(control, routine)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define USE_ATOMICS 1
|
#define USE_ATOMICS 1
|
||||||
@@ -54,6 +59,18 @@
|
|||||||
#define ff_mutex_unlock(mutex) (0)
|
#define ff_mutex_unlock(mutex) (0)
|
||||||
#define ff_mutex_destroy(mutex) (0)
|
#define ff_mutex_destroy(mutex) (0)
|
||||||
|
|
||||||
|
#define AVOnce char
|
||||||
|
#define AV_ONCE_INIT 0
|
||||||
|
|
||||||
|
static inline int ff_thread_once(char *control, void (*routine)(void))
|
||||||
|
{
|
||||||
|
if (!*control) {
|
||||||
|
routine();
|
||||||
|
*control = 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* AVUTIL_THREAD_H */
|
#endif /* AVUTIL_THREAD_H */
|
||||||
|
Reference in New Issue
Block a user