Index: src/platform-macos.cc |
diff --git a/src/platform-macos.cc b/src/platform-macos.cc |
index f4d8b33817990f918c4d25eefbbcf453702f91b2..e8c25fae93ad0cce3ec54a96a50270fc762c47f8 100644 |
--- a/src/platform-macos.cc |
+++ b/src/platform-macos.cc |
@@ -652,45 +652,6 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) { |
} |
-void Thread::YieldCPU() { |
- sched_yield(); |
-} |
- |
- |
-class MacOSMutex : public Mutex { |
- public: |
- MacOSMutex() { |
- pthread_mutexattr_t attr; |
- pthread_mutexattr_init(&attr); |
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); |
- pthread_mutex_init(&mutex_, &attr); |
Dmitry Lomov (no reviews)
2013/07/11 10:52:16
Hmm MacOS mutex did not have pthread_mutexattr_des
Benedikt Meurer
2013/07/11 10:58:45
Yeah, it's currently a no-op on OS X, but that mig
|
- } |
- |
- virtual ~MacOSMutex() { 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_; |
-}; |
- |
- |
-Mutex* OS::CreateMutex() { |
- return new MacOSMutex(); |
-} |
- |
- |
class MacOSSemaphore : public Semaphore { |
public: |
explicit MacOSSemaphore(int count) { |