sanitizer_common: add Semaphore
authorDmitry Vyukov <dvyukov@google.com>
Thu, 15 Jul 2021 15:15:48 +0000 (17:15 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Fri, 16 Jul 2021 17:34:24 +0000 (19:34 +0200)
commit6a4054ef060ba9cd6fac1b68f226f5b142f0a543
treeeb2c61a67ee71c4fb4e03e72adb442d0f4cf3be2
parent2b3a4c7d72be4fd6792ea6bba59cfd11d34c8f88
sanitizer_common: add Semaphore

Semaphore is a portable way to park/unpark threads.
The plan is to use it to implement a portable blocking
mutex in subsequent changes. Semaphore can also be used
to efficiently wait for other things (e.g. we currently
spin to synchronize thread creation and start).

Reviewed By: vitalybuka, melver

Differential Revision: https://reviews.llvm.org/D106071
compiler-rt/lib/sanitizer_common/CMakeLists.txt
compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp [new file with mode: 0644]
compiler-rt/lib/sanitizer_common/sanitizer_mutex.h
compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
compiler-rt/lib/sanitizer_common/tests/sanitizer_mutex_test.cpp
compiler-rt/lib/tsan/go/build.bat
compiler-rt/lib/tsan/go/buildgo.sh