Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(652)

Unified Diff: src/platform-macos.cc

Issue 18335008: Cleanup common POSIX functionality. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Mark result as used Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform-linux.cc ('k') | src/platform-openbsd.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « src/platform-linux.cc ('k') | src/platform-openbsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698