| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
3703f13333 |
avutil/tests: run the cpu_init.c test conditionally on HAVE_THREADS
Suggested by Diego Biurrun and James Almer. Signed-off-by: Wan-Teh Chang <wtc@google.com> Signed-off-by: James Almer <jamrial@gmail.com> |
9 years ago |
|
|
8986885801 |
avutil/cpu_init: remove unnecessary arguments to the main() function
Signed-off-by: James Almer <jamrial@gmail.com> |
9 years ago |
|
|
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>
|
9 years ago |
|
|
d84a21207e |
avutil/tests: Add cpu_init.c to check whether the one-time initialization in av_get_cpu_flags() has data races.
Co-author: Dmitry Vyukov of Google Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
9 years ago |