Index: src/platform-linux.cc |
diff --git a/src/platform-linux.cc b/src/platform-linux.cc |
index 007b1e7737077a82575169c9b3e96d4c3af5fc5e..e0d3de60b8fc6df4c69a9ea30e454740ee78cc30 100644 |
--- a/src/platform-linux.cc |
+++ b/src/platform-linux.cc |
@@ -893,56 +893,6 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) { |
} |
-void Thread::YieldCPU() { |
- sched_yield(); |
-} |
- |
- |
-class LinuxMutex : public Mutex { |
- public: |
- LinuxMutex() { |
- pthread_mutexattr_t attrs; |
- int result = pthread_mutexattr_init(&attrs); |
- ASSERT(result == 0); |
- result = pthread_mutexattr_settype(&attrs, PTHREAD_MUTEX_RECURSIVE); |
- ASSERT(result == 0); |
- result = pthread_mutex_init(&mutex_, &attrs); |
- ASSERT(result == 0); |
- USE(result); |
- } |
- |
- virtual ~LinuxMutex() { pthread_mutex_destroy(&mutex_); } |
- |
- virtual int Lock() { |
- int result = pthread_mutex_lock(&mutex_); |
- return result; |
- } |
- |
- virtual int Unlock() { |
- int result = pthread_mutex_unlock(&mutex_); |
- return result; |
- } |
- |
- 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 LinuxMutex(); |
-} |
- |
- |
class LinuxSemaphore : public Semaphore { |
public: |
explicit LinuxSemaphore(int count) { sem_init(&sem_, 0, count); } |