diff options
Diffstat (limited to 'src/3rdparty/v8/src/platform-macos.cc')
-rw-r--r-- | src/3rdparty/v8/src/platform-macos.cc | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/3rdparty/v8/src/platform-macos.cc b/src/3rdparty/v8/src/platform-macos.cc index a937ed3..22d2bcf 100644 --- a/src/3rdparty/v8/src/platform-macos.cc +++ b/src/3rdparty/v8/src/platform-macos.cc @@ -471,6 +471,11 @@ bool VirtualMemory::ReleaseRegion(void* address, size_t size) { } +bool VirtualMemory::HasLazyCommits() { + return false; +} + + class Thread::PlatformData : public Malloced { public: PlatformData() : thread_(kNoThread) {} @@ -682,17 +687,27 @@ Mutex* OS::CreateMutex() { class MacOSSemaphore : public Semaphore { public: explicit MacOSSemaphore(int count) { - semaphore_create(mach_task_self(), &semaphore_, SYNC_POLICY_FIFO, count); + int r; + r = semaphore_create(mach_task_self(), + &semaphore_, + SYNC_POLICY_FIFO, + count); + ASSERT(r == KERN_SUCCESS); } ~MacOSSemaphore() { - semaphore_destroy(mach_task_self(), semaphore_); + int r; + r = semaphore_destroy(mach_task_self(), semaphore_); + ASSERT(r == KERN_SUCCESS); } - // The MacOS mach semaphore documentation claims it does not have spurious - // wakeups, the way pthreads semaphores do. So the code from the linux - // platform is not needed here. - void Wait() { semaphore_wait(semaphore_); } + void Wait() { + int r; + do { + r = semaphore_wait(semaphore_); + ASSERT(r == KERN_SUCCESS || r == KERN_ABORTED); + } while (r == KERN_ABORTED); + } bool Wait(int timeout); |