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

Side by Side Diff: src/base/platform/semaphore.cc

Issue 358363002: Move platform abstraction to base library (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "src/platform/semaphore.h" 5 #include "src/base/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 "src/checks.h" 14 #include "src/base/logging.h"
15 #include "src/platform/time.h" 15 #include "src/base/platform/time.h"
16 16
17 namespace v8 { 17 namespace v8 {
18 namespace internal { 18 namespace base {
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);
26 USE(result); 26 USE(result);
27 } 27 }
28 28
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 return false; 181 return false;
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::base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698