diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2012-06-29 17:10:08 +0000 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2012-06-29 17:10:08 +0000 |
| commit | 7a9fa7dbc5c87b6ae6c8c4a38de6acba3a05d29f (patch) | |
| tree | 0b19be241b3b9e62ad8effa112177dd24ace7922 /compiler-rt/lib/tsan | |
| parent | 6fa46f7003dbeb0a3542da08311e1cae2df91b5e (diff) | |
| download | bcm5719-llvm-7a9fa7dbc5c87b6ae6c8c4a38de6acba3a05d29f.tar.gz bcm5719-llvm-7a9fa7dbc5c87b6ae6c8c4a38de6acba3a05d29f.zip | |
tsan/asan: unify ScopedLock
llvm-svn: 159438
Diffstat (limited to 'compiler-rt/lib/tsan')
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_mutex.cc | 18 | ||||
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_mutex.h | 26 |
2 files changed, 3 insertions, 41 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_mutex.cc b/compiler-rt/lib/tsan/rtl/tsan_mutex.cc index 1ef48a07c94..68eab5d6c8f 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_mutex.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_mutex.cc @@ -256,22 +256,4 @@ void Mutex::ReadUnlock() { #endif } -Lock::Lock(Mutex *m) - : m_(m) { - m_->Lock(); -} - -Lock::~Lock() { - m_->Unlock(); -} - -ReadLock::ReadLock(Mutex *m) - : m_(m) { - m_->ReadLock(); -} - -ReadLock::~ReadLock() { - m_->ReadUnlock(); -} - } // namespace __tsan diff --git a/compiler-rt/lib/tsan/rtl/tsan_mutex.h b/compiler-rt/lib/tsan/rtl/tsan_mutex.h index 6fbf8220eab..5b22a414518 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_mutex.h +++ b/compiler-rt/lib/tsan/rtl/tsan_mutex.h @@ -14,6 +14,7 @@ #define TSAN_MUTEX_H #include "sanitizer_common/sanitizer_atomic.h" +#include "sanitizer_common/sanitizer_mutex.h" #include "tsan_defs.h" namespace __tsan { @@ -57,29 +58,8 @@ class Mutex { void operator = (const Mutex&); }; -class Lock { - public: - explicit Lock(Mutex *m); - ~Lock(); - - private: - Mutex *m_; - - Lock(const Lock&); - void operator = (const Lock&); -}; - -class ReadLock { - public: - explicit ReadLock(Mutex *m); - ~ReadLock(); - - private: - Mutex *m_; - - ReadLock(const ReadLock&); - void operator = (const ReadLock&); -}; +typedef GenericScopedLock<Mutex> Lock; +typedef GenericScopedReadLock<Mutex> ReadLock; class DeadlockDetector { public: |

