From c6b7a4dacee3067ad00abdb3abf71c7e8eb62e78 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 6 Sep 2016 20:13:30 +0200 Subject: atomics: readd some emulation This time it's emulation that's supposed to work (not just dummied out). Unlike the previous emulation, no mpv code has to be disabled, and everything should work (albeit possibly a bit slowly). On the other hand, it's not possible to implement this kind of emulation without compiler support. We use GNU statement expressions and __typeof__ in this case. This code is inactive if stdatomic.h is available. --- player/main.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'player/main.c') diff --git a/player/main.c b/player/main.c index 0bf207f5b7..b1aa30f9c3 100644 --- a/player/main.c +++ b/player/main.c @@ -75,6 +75,10 @@ #define FULLCONFIG "(missing)\n" #endif +#if !(HAVE_STDATOMIC || HAVE_ATOMIC_BUILTINS || HAVE_SYNC_BUILTINS) +pthread_mutex_t mp_atomic_mutex = PTHREAD_MUTEX_INITIALIZER; +#endif + enum exit_reason { EXIT_NONE, EXIT_NORMAL, -- cgit v1.2.3