| Index: src/platform-macos.cc
|
| diff --git a/src/platform-macos.cc b/src/platform-macos.cc
|
| index 7aa02a7674f96697306e244bdeb6e13f04809a5b..d6d3128560f1f125ec197e60508a7ee9237dd25c 100644
|
| --- a/src/platform-macos.cc
|
| +++ b/src/platform-macos.cc
|
| @@ -392,53 +392,6 @@ bool VirtualMemory::HasLazyCommits() {
|
| }
|
|
|
|
|
| -class MacOSSemaphore : public Semaphore {
|
| - public:
|
| - explicit MacOSSemaphore(int count) {
|
| - int r;
|
| - r = semaphore_create(mach_task_self(),
|
| - &semaphore_,
|
| - SYNC_POLICY_FIFO,
|
| - count);
|
| - ASSERT(r == KERN_SUCCESS);
|
| - }
|
| -
|
| - ~MacOSSemaphore() {
|
| - int r;
|
| - r = semaphore_destroy(mach_task_self(), semaphore_);
|
| - ASSERT(r == KERN_SUCCESS);
|
| - }
|
| -
|
| - void Wait() {
|
| - int r;
|
| - do {
|
| - r = semaphore_wait(semaphore_);
|
| - ASSERT(r == KERN_SUCCESS || r == KERN_ABORTED);
|
| - } while (r == KERN_ABORTED);
|
| - }
|
| -
|
| - bool Wait(int timeout);
|
| -
|
| - void Signal() { semaphore_signal(semaphore_); }
|
| -
|
| - private:
|
| - semaphore_t semaphore_;
|
| -};
|
| -
|
| -
|
| -bool MacOSSemaphore::Wait(int timeout) {
|
| - mach_timespec_t ts;
|
| - ts.tv_sec = timeout / 1000000;
|
| - ts.tv_nsec = (timeout % 1000000) * 1000;
|
| - return semaphore_timedwait(semaphore_, ts) != KERN_OPERATION_TIMED_OUT;
|
| -}
|
| -
|
| -
|
| -Semaphore* OS::CreateSemaphore(int count) {
|
| - return new MacOSSemaphore(count);
|
| -}
|
| -
|
| -
|
| void OS::SetUp() {
|
| // Seed the random number generator. We preserve microsecond resolution.
|
| uint64_t seed = static_cast<uint64_t>(TimeCurrentMillis()) ^ (getpid() << 16);
|
|
|