Fix data race detected by ThreadSanitizer
authorAnton Mitrofanov <BugMaster@narod.ru>
Mon, 4 Feb 2019 18:46:12 +0000 (21:46 +0300)
committerAnton Mitrofanov <BugMaster@narod.ru>
Mon, 4 Feb 2019 19:13:52 +0000 (22:13 +0300)
Bug report by Daniel Deptford.

common/threadpool.c

index c46cad6..0d2be8e 100644 (file)
@@ -34,7 +34,7 @@ typedef struct
 
 struct x264_threadpool_t
 {
-    int            exit;
+    volatile int   exit;
     int            threads;
     x264_pthread_t *thread_handle;
     void           (*init_func)(void *);