Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | [tsan] Add Mutex annotation flag for constant-initialized ↵ | Dmitry Vyukov | 2017-10-20 | 1 | -4/+6 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | __tsan_mutex_linker_init behavior Add a new flag, __tsan_mutex_not_static, which has the opposite sense of __tsan_mutex_linker_init. When the new __tsan_mutex_not_static flag is passed to __tsan_mutex_destroy, tsan ignores the destruction unless the mutex was also created with the __tsan_mutex_not_static flag. This is useful for constructors that otherwise woud set __tsan_mutex_linker_init but cannot, because they are declared constexpr. Google has a custom mutex with two constructors, a "linker initialized" constructor that relies on zero-initialization and sets __tsan_mutex_linker_init, and a normal one which sets no tsan flags. The "linker initialized" constructor is morally constexpr, but we can't declare it constexpr because of the need to call into tsan as a side effect. With this new flag, the normal c'tor can set __tsan_mutex_not_static, the "linker initialized" constructor can rely on tsan's lazy initialization, and __tsan_mutex_destroy can still handle both cases correctly. Author: Greg Falcon (gfalcon) Reviewed in: https://reviews.llvm.org/D39095 llvm-svn: 316209 | ||||
* | tsan: fix reading of mutex flags | Dmitry Vyukov | 2017-06-13 | 1 | -3/+3 |
| | | | | | | | SyncVar::IsFlagSet returns true if any flag is set. This is wrong. Check the actual requested flag. llvm-svn: 305281 | ||||
* | tsan: add new mutex annotations | Dmitry Vyukov | 2017-03-26 | 1 | -0/+91 |
There are several problems with the current annotations (AnnotateRWLockCreate and friends): - they don't fully support deadlock detection (we need a hook _before_ mutex lock) - they don't support insertion of random artificial delays to perturb execution (again we need a hook _before_ mutex lock) - they don't support setting extended mutex attributes like read/write reentrancy (only "linker init" was bolted on) - they don't support setting mutex attributes if a mutex don't have a "constructor" (e.g. static, Java, Go mutexes) - they don't ignore synchronization inside of lock/unlock operations which leads to slowdown and false negatives The new annotations solve of the above problems. See tsan_interface.h for the interface specification and comments. Reviewed in https://reviews.llvm.org/D31093 llvm-svn: 298809 |