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

Side by Side Diff: base/threading/platform_thread_win.cc

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 9 years, 11 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
« no previous file with comments | « base/threading/platform_thread_unittest.cc ('k') | base/threading/simple_thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium 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 "base/platform_thread.h" 5 #include "base/threading/platform_thread.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/thread_restrictions.h" 8 #include "base/thread_restrictions.h"
9 #include "base/win/windows_version.h" 9 #include "base/win/windows_version.h"
10 10
11 namespace base {
12
11 namespace { 13 namespace {
12 14
13 // The information on how to set the thread name comes from 15 // The information on how to set the thread name comes from
14 // a MSDN article: http://msdn2.microsoft.com/en-us/library/xcb2z8hs.aspx 16 // a MSDN article: http://msdn2.microsoft.com/en-us/library/xcb2z8hs.aspx
15 const DWORD kVCThreadNameException = 0x406D1388; 17 const DWORD kVCThreadNameException = 0x406D1388;
16 18
17 typedef struct tagTHREADNAME_INFO { 19 typedef struct tagTHREADNAME_INFO {
18 DWORD dwType; // Must be 0x1000. 20 DWORD dwType; // Must be 0x1000.
19 LPCSTR szName; // Pointer to name (in user addr space). 21 LPCSTR szName; // Pointer to name (in user addr space).
20 DWORD dwThreadID; // Thread ID (-1=caller thread). 22 DWORD dwThreadID; // Thread ID (-1=caller thread).
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 base::ThreadRestrictions::AssertIOAllowed(); 136 base::ThreadRestrictions::AssertIOAllowed();
135 #endif 137 #endif
136 138
137 // Wait for the thread to exit. It should already have terminated but make 139 // Wait for the thread to exit. It should already have terminated but make
138 // sure this assumption is valid. 140 // sure this assumption is valid.
139 DWORD result = WaitForSingleObject(thread_handle, INFINITE); 141 DWORD result = WaitForSingleObject(thread_handle, INFINITE);
140 DCHECK_EQ(WAIT_OBJECT_0, result); 142 DCHECK_EQ(WAIT_OBJECT_0, result);
141 143
142 CloseHandle(thread_handle); 144 CloseHandle(thread_handle);
143 } 145 }
146
147 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/platform_thread_unittest.cc ('k') | base/threading/simple_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698