opencl: Make init_mtx static with volatile lock
authorMatt Oliver <protogonoi@gmail.com>
Sat, 10 May 2014 11:00:32 +0000 (21:00 +1000)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 10 May 2014 13:07:33 +0000 (15:07 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/opencl.c

index 3eb0ed0..a92bce7 100644 (file)
@@ -37,7 +37,7 @@
 #endif
 #include "atomic.h"
 
-static pthread_mutex_t *atomic_opencl_lock = NULL;
+static volatile pthread_mutex_t *atomic_opencl_lock = NULL;
 #define LOCK_OPENCL pthread_mutex_lock(atomic_opencl_lock)
 #define UNLOCK_OPENCL pthread_mutex_unlock(atomic_opencl_lock)
 #else
@@ -326,7 +326,7 @@ void av_opencl_free_device_list(AVOpenCLDeviceList **device_list)
     av_freep(device_list);
 }
 
-inline int init_opencl_mtx(void)
+static inline int init_opencl_mtx(void)
 {
 #if HAVE_THREADS
     if (!atomic_opencl_lock) {