| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/semaphore.h" | 5 #include "src/platform/semaphore.h" |
| 6 | 6 |
| 7 #if V8_OS_MACOSX | 7 #if V8_OS_MACOSX |
| 8 #include <mach/mach_init.h> | 8 #include <mach/mach_init.h> |
| 9 #include <mach/task.h> | 9 #include <mach/task.h> |
| 10 #endif | 10 #endif |
| 11 | 11 |
| 12 #include <errno.h> | 12 #include <errno.h> |
| 13 | 13 |
| 14 #include "checks.h" | 14 #include "src/checks.h" |
| 15 #include "platform/time.h" | 15 #include "src/platform/time.h" |
| 16 | 16 |
| 17 namespace v8 { | 17 namespace v8 { |
| 18 namespace internal { | 18 namespace internal { |
| 19 | 19 |
| 20 #if V8_OS_MACOSX | 20 #if V8_OS_MACOSX |
| 21 | 21 |
| 22 Semaphore::Semaphore(int count) { | 22 Semaphore::Semaphore(int count) { |
| 23 kern_return_t result = semaphore_create( | 23 kern_return_t result = semaphore_create( |
| 24 mach_task_self(), &native_handle_, SYNC_POLICY_FIFO, count); | 24 mach_task_self(), &native_handle_, SYNC_POLICY_FIFO, count); |
| 25 ASSERT_EQ(KERN_SUCCESS, result); | 25 ASSERT_EQ(KERN_SUCCESS, result); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 } | 182 } |
| 183 ASSERT(result == WAIT_OBJECT_0); | 183 ASSERT(result == WAIT_OBJECT_0); |
| 184 return true; | 184 return true; |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 } | 187 } |
| 188 | 188 |
| 189 #endif // V8_OS_MACOSX | 189 #endif // V8_OS_MACOSX |
| 190 | 190 |
| 191 } } // namespace v8::internal | 191 } } // namespace v8::internal |
| OLD | NEW |