Index: src/platform-posix.cc |
diff --git a/src/platform-posix.cc b/src/platform-posix.cc |
index dd6b77c265464f1c62c3e7c391db8bc5d8514737..aaf0ca7e0dc81fbf8e7940ff80e6bcda1dab8240 100644 |
--- a/src/platform-posix.cc |
+++ b/src/platform-posix.cc |
@@ -739,48 +739,6 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) { |
} |
-class POSIXMutex : public Mutex { |
- public: |
- POSIXMutex() { |
- pthread_mutexattr_t attr; |
- memset(&attr, 0, sizeof(attr)); |
- int result = pthread_mutexattr_init(&attr); |
- ASSERT(result == 0); |
- result = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); |
- ASSERT(result == 0); |
- result = pthread_mutex_init(&mutex_, &attr); |
- ASSERT(result == 0); |
- result = pthread_mutexattr_destroy(&attr); |
- ASSERT(result == 0); |
- USE(result); |
- } |
- |
- virtual ~POSIXMutex() { pthread_mutex_destroy(&mutex_); } |
- |
- virtual int Lock() { return pthread_mutex_lock(&mutex_); } |
- |
- virtual int Unlock() { return pthread_mutex_unlock(&mutex_); } |
- |
- virtual bool TryLock() { |
- int result = pthread_mutex_trylock(&mutex_); |
- // Return false if the lock is busy and locking failed. |
- if (result == EBUSY) { |
- return false; |
- } |
- ASSERT(result == 0); // Verify no other errors. |
- return true; |
- } |
- |
- private: |
- pthread_mutex_t mutex_; // Pthread mutex for POSIX platforms. |
-}; |
- |
- |
-Mutex* OS::CreateMutex() { |
- return new POSIXMutex(); |
-} |
- |
- |
// ---------------------------------------------------------------------------- |
// POSIX socket support. |
// |