mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
2170017a1c
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> |
||
---|---|---|
.. | ||
aac.mak | ||
ac3.mak | ||
acodec.mak | ||
adpcm.mak | ||
alac.mak | ||
als.mak | ||
amrnb.mak | ||
amrwb.mak | ||
atrac.mak | ||
audio.mak | ||
avformat.mak | ||
bmp.mak | ||
canopus.mak | ||
cdxl.mak | ||
checkasm.mak | ||
cover-art.mak | ||
demux.mak | ||
dfa.mak | ||
dpcm.mak | ||
ea.mak | ||
fft.mak | ||
filter-audio.mak | ||
filter-video.mak | ||
flac.mak | ||
h264.mak | ||
hevc.mak | ||
image.mak | ||
indeo.mak | ||
libavcodec.mak | ||
libavdevice.mak | ||
libavformat.mak | ||
libavresample.mak | ||
libavutil.mak | ||
lossless-audio.mak | ||
lossless-video.mak | ||
microsoft.mak | ||
monkeysaudio.mak | ||
mov.mak | ||
mp3.mak | ||
mpc.mak | ||
mpeg4.mak | ||
opus.mak | ||
pcm.mak | ||
probe.mak | ||
prores.mak | ||
qt.mak | ||
qtrle.mak | ||
real.mak | ||
screen.mak | ||
seek.mak | ||
utvideo.mak | ||
vcodec.mak | ||
video.mak | ||
voice.mak | ||
vorbis.mak | ||
vpx.mak | ||
vqf.mak | ||
wavpack.mak | ||
wma.mak | ||
xvid.mak |