FFmpeg/tests
Wan-Teh Chang 2170017a1c avutil: fix data race in av_get_cpu_flags()
Make the one-time initialization in av_get_cpu_flags() thread-safe. The
static variables |flags|, |cpuflags_mask|, and |checked| in
libavutil/cpu.c are 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.

Remove the |checked| variable because the invalid value of -1 for
|flags| can be used to indicate the same condition. Rename |flags| to
|cpu_flags| and move it to file scope.

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>
2016-12-08 15:53:58 -05:00
..
checkasm Remove Plan 9 support 2016-12-03 09:15:01 +01:00
fate avutil: fix data race in av_get_cpu_flags() 2016-12-08 15:53:58 -05:00
filtergraphs FATE: add a test for the ONE_STR mapping mode of the channelmap filter 2014-03-16 07:44:03 +01:00
ref fate: Add spherical and stereo3d mov tests 2016-12-07 14:35:08 -05:00
.gitignore Split global .gitignore file into per-directory files 2016-05-13 14:55:56 +02:00
audiogen.c cosmetics: Write NULL pointer inequality checks more compactly 2014-08-15 05:34:13 -07:00
base64.c
fate-run.sh fate: Add tests for mov display matrix 2016-11-01 11:55:54 -04:00
fate.sh fate.sh: Allow setting other make flags for running tests 2016-11-23 15:05:51 +02:00
lavf-regression.sh Remove avserver. 2014-06-18 14:55:28 +02:00
Makefile fate: Add tests for mov display matrix 2016-11-01 11:55:54 -04:00
md5.sh
reference.pnm Replace lena.pnm 2014-11-28 17:55:27 -05:00
regression-funcs.sh lavf: add AVFMT_FLAG_BITEXACT. 2014-05-15 07:42:07 +02:00
rotozoom.c
tiny_psnr.c Drop pointless assert.h #includes 2016-05-03 15:45:10 +02:00
utils.c
videogen.c