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

Unified Diff: base/threading/platform_thread.h

Issue 6001010: Move platform_thread to base/threading and put in the base namespace. I left ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/thread_unittest.cc ('k') | base/threading/platform_thread_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « base/thread_unittest.cc ('k') | base/threading/platform_thread_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698