summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/tsan/rtl')
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_mutex.cc18
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_mutex.h26
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:
OpenPOWER on IntegriCloud