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

Unified Diff: src/platform-solaris.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
« src/platform-macos.cc ('K') | « src/platform-posix.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-solaris.cc
diff --git a/src/platform-solaris.cc b/src/platform-solaris.cc
index 4b0094fb22fe6cc2e8df3c5b9c9fc112f858adb4..3c4df665f0cfe2748191fc83e8f511e95d61bfd4 100644
--- a/src/platform-solaris.cc
+++ b/src/platform-solaris.cc
@@ -38,7 +38,6 @@
#include <ucontext.h> // walkstack(), getcontext()
#include <dlfcn.h> // dladdr
#include <pthread.h>
-#include <sched.h> // for sched_yield
#include <semaphore.h>
#include <time.h>
#include <sys/time.h> // gettimeofday(), timeradd()
@@ -539,46 +538,6 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
}
-void Thread::YieldCPU() {
- sched_yield();
-}
-
-
-class SolarisMutex : public Mutex {
- public:
- SolarisMutex() {
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(&mutex_, &attr);
- }
-
- ~SolarisMutex() { pthread_mutex_destroy(&mutex_); }
-
- int Lock() { return pthread_mutex_lock(&mutex_); }
-
- 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 SolarisMutex();
-}
-
-
class SolarisSemaphore : public Semaphore {
public:
explicit SolarisSemaphore(int count) { sem_init(&sem_, 0, count); }
« src/platform-macos.cc ('K') | « src/platform-posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698