Index: base/threading/platform_thread.h |
=================================================================== |
--- base/threading/platform_thread.h (revision 70321) |
+++ base/threading/platform_thread.h (working copy) |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -6,30 +6,40 @@ |
// the low-level platform-specific abstraction to the OS's threading interface. |
// You should instead be using a message-loop driven Thread, see thread.h. |
-#ifndef BASE_PLATFORM_THREAD_H_ |
-#define BASE_PLATFORM_THREAD_H_ |
+#ifndef BASE_THREADING_PLATFORM_THREAD_H_ |
+#define BASE_THREADING_PLATFORM_THREAD_H_ |
#pragma once |
#include "base/basictypes.h" |
+#include "build/build_config.h" |
+#if defined(OS_WIN) |
+#include <windows.h> |
+#elif defined(OS_POSIX) |
+#include <pthread.h> |
+#if defined(OS_MACOSX) |
+#include <mach/mach.h> |
+#else // OS_POSIX && !OS_MACOSX |
+#include <unistd.h> |
+#endif |
+#endif |
+ |
+namespace base { |
+ |
// PlatformThreadHandle should not be assumed to be a numeric type, since the |
// standard intends to allow pthread_t to be a structure. This means you |
// should not initialize it to a value, like 0. If it's a member variable, the |
// constructor can safely "value initialize" using () in the initializer list. |
#if defined(OS_WIN) |
-#include <windows.h> |
typedef DWORD PlatformThreadId; |
typedef void* PlatformThreadHandle; // HANDLE |
const PlatformThreadHandle kNullThreadHandle = NULL; |
#elif defined(OS_POSIX) |
-#include <pthread.h> |
typedef pthread_t PlatformThreadHandle; |
const PlatformThreadHandle kNullThreadHandle = 0; |
#if defined(OS_MACOSX) |
-#include <mach/mach.h> |
typedef mach_port_t PlatformThreadId; |
#else // OS_POSIX && !OS_MACOSX |
-#include <unistd.h> |
typedef pid_t PlatformThreadId; |
#endif |
#endif |
@@ -84,4 +94,6 @@ |
DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread); |
}; |
-#endif // BASE_PLATFORM_THREAD_H_ |
+} // namespace base |
+ |
+#endif // BASE_THREADING_PLATFORM_THREAD_H_ |