diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2013-01-14 07:51:39 +0000 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2013-01-14 07:51:39 +0000 |
commit | f4f51f2cc6fa936f0c65577f82e6b62989d546ee (patch) | |
tree | 34d2da3ba388fe5080f454868838454beab686b8 /lib/asan/asan_lock.h | |
parent | 4785a776d09fb36bb2b162c3be40cd7ca017fce0 (diff) | |
download | compiler-rt-f4f51f2cc6fa936f0c65577f82e6b62989d546ee.tar.gz compiler-rt-f4f51f2cc6fa936f0c65577f82e6b62989d546ee.tar.bz2 compiler-rt-f4f51f2cc6fa936f0c65577f82e6b62989d546ee.tar.xz |
asan/tsan: move blocking mutex from asan to sanitizer_common
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@172380 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_lock.h')
-rw-r--r-- | lib/asan/asan_lock.h | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/lib/asan/asan_lock.h b/lib/asan/asan_lock.h index edee49ad..e69de29b 100644 --- a/lib/asan/asan_lock.h +++ b/lib/asan/asan_lock.h @@ -1,42 +0,0 @@ -//===-- asan_lock.h ---------------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file is a part of AddressSanitizer, an address sanity checker. -// -// A wrapper for a simple lock. -//===----------------------------------------------------------------------===// -#ifndef ASAN_LOCK_H -#define ASAN_LOCK_H - -#include "sanitizer_common/sanitizer_mutex.h" -#include "asan_internal.h" - -// The locks in ASan are global objects and they are never destroyed to avoid -// at-exit races (that is, a lock is being used by other threads while the main -// thread is doing atexit destructors). -// We define the class using opaque storage to avoid including system headers. - -namespace __asan { - -class AsanLock { - public: - explicit AsanLock(LinkerInitialized); - void Lock(); - void Unlock(); - bool IsLocked() { return owner_ != 0; } - private: - uptr opaque_storage_[10]; - uptr owner_; // for debugging and for malloc_introspection_t interface -}; - -typedef GenericScopedLock<AsanLock> ScopedLock; - -} // namespace __asan - -#endif // ASAN_LOCK_H |