1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-04 06:08:26 +02:00
FFmpeg/libavutil
Wan-Teh Chang fed50c4304 avutil: fix data race in av_get_cpu_flags()
Make the one-time initialization in av_get_cpu_flags() thread-safe. The
static variable |cpu_flags| in libavutil/cpu.c is read and written using
normal load and store operations. These are considered as data races.
The fix is to use atomic load and store operations.

The fix can be verified by running the libavutil/tests/cpu_init.c test
program under ThreadSanitizer:
    ./configure --toolchain=clang-tsan
    make libavutil/tests/cpu_init
    libavutil/tests/cpu_init

There should be no warnings from ThreadSanitizer.

Co-author: Dmitry Vyukov of Google, who suggested the data race fix.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-13 00:07:20 +01:00
..
2015-12-15 14:16:28 +01:00
2016-02-18 11:55:00 +01:00
2016-03-28 14:13:17 -08:00
2014-08-05 01:54:47 +02:00
2016-05-04 18:16:21 +02:00
2015-11-01 19:35:01 -05:00
2016-06-03 14:49:56 +02:00
2015-09-05 18:07:20 +02:00
2016-12-10 22:24:10 +01:00
2016-12-10 22:24:10 +01:00
2015-10-11 18:03:10 -04:00
2016-01-13 20:00:19 -05:00
2016-08-02 07:50:44 -07:00
2016-11-23 02:01:05 +01:00
2016-11-22 10:07:43 -08:00
2014-08-05 21:05:52 +02:00
2016-11-22 10:07:43 -08:00
2016-01-28 19:49:48 -08:00
2016-08-02 21:52:40 -07:00
2015-12-03 04:09:48 +01:00
2016-10-21 23:58:47 +02:00
2016-10-22 13:50:09 +02:00
2016-12-10 22:24:10 +01:00