summaryrefslogtreecommitdiff
path: root/vpx_util/vpx_atomics.h
AgeCommit message (Collapse)Author
2018-09-15cosmetics: normalize include guardsJames Zern
use the recommended format [1] of: <PROJECT>_<PATH>_<FILE>_H_ [1] https://google.github.io/styleguide/cppguide.html#The__define_Guard "All header files should have #define guards to prevent multiple inclusion. The format of the symbol name should be <PROJECT>_<PATH>_<FILE>_H_." Change-Id: I2e8ab0b32fb23c30fa43cff5fec12d043c0d2037
2018-01-12clang-format v5.0.0 vpx_util/vpx_atomic.hJohann
Allow*OnASingleLine appears to no longer apply to typedef structs. Change-Id: If10db1c30c74ee31dad1a0b1926964e850f15fd2
2017-09-06Remove support for stdatomic.h.Peter Boström
This header doesn't build on g++ v6 as it's a C and not C++ header (_Atomic is not a keyword in C++11). Since the C and C++ invocations cannot be guaranteed to point to the same underlying atomic_int implementation, remove support for them and use compiler intrinsics instead. BUG=webm:1461 Change-Id: Ie1cd6759c258042efc87f51f036b9aa53e4ea9d5
2017-08-31Add atomics to vp8 synchronization primitives.Peter Boström
Fixes issue on iPad Pro 10.5 (and probably other places) where threads are not properly synchronized. On x86 this data race was benign as load and store instructions are atomic, they were being atomic in practice as the program hasn't been observed to be miscompiled. Such guarantees are not made outside x86, and real problems manifested where libvpx reliably reproduced a broken bitstream for even just the initial keyframe. This was detected in WebRTC where this device started using multithreading (as its CPU count is higher than earlier devices, where the problem did not manifest as single-threading was used in practice). This issue was not detected under thread-sanitizer bots as mutexes were conditionally used under this platform to simulate the protected read and write semantics that were in practice provided on x86 platforms. This change also removes several mutexes, so encoder/decoder state is lighter-weight after this change and we do not need to initialize so many mutexes (this was done even on non-thread-sanitizer platforms where they were unused). Change-Id: If41fcb0d99944f7bbc8ec40877cdc34d672ae72a