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

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

Issue 10496002: Revert 140102 - Remove old PostDelayedTask interfaces that use int ms instead of TimeDelta. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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_posix.cc ('k') | base/threading/sequenced_worker_pool.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/threading/platform_thread.h" 5 #include "base/threading/platform_thread.h"
6 6
7 #include "base/debug/alias.h" 7 #include "base/debug/alias.h"
8 #include "base/debug/profiler.h" 8 #include "base/debug/profiler.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/threading/thread_local.h" 10 #include "base/threading/thread_local.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 PlatformThreadId PlatformThread::CurrentId() { 103 PlatformThreadId PlatformThread::CurrentId() {
104 return GetCurrentThreadId(); 104 return GetCurrentThreadId();
105 } 105 }
106 106
107 // static 107 // static
108 void PlatformThread::YieldCurrentThread() { 108 void PlatformThread::YieldCurrentThread() {
109 ::Sleep(0); 109 ::Sleep(0);
110 } 110 }
111 111
112 // static 112 // static
113 void PlatformThread::Sleep(int duration_ms) {
114 ::Sleep(duration_ms);
115 }
116
117 // static
113 void PlatformThread::Sleep(TimeDelta duration) { 118 void PlatformThread::Sleep(TimeDelta duration) {
114 ::Sleep(duration.InMillisecondsRoundedUp()); 119 ::Sleep(duration.InMillisecondsRoundedUp());
115 } 120 }
116 121
117 // static 122 // static
118 void PlatformThread::SetName(const char* name) { 123 void PlatformThread::SetName(const char* name) {
119 current_thread_name.Set(const_cast<char*>(name)); 124 current_thread_name.Set(const_cast<char*>(name));
120 125
121 // On Windows only, we don't need to tell the profiler about the "BrokerEvent" 126 // On Windows only, we don't need to tell the profiler about the "BrokerEvent"
122 // thread, as it exists only in the chrome.exe image, and never spawns or runs 127 // thread, as it exists only in the chrome.exe image, and never spawns or runs
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 case kThreadPriority_Normal: 203 case kThreadPriority_Normal:
199 ::SetThreadPriority(handle, THREAD_PRIORITY_NORMAL); 204 ::SetThreadPriority(handle, THREAD_PRIORITY_NORMAL);
200 break; 205 break;
201 case kThreadPriority_RealtimeAudio: 206 case kThreadPriority_RealtimeAudio:
202 ::SetThreadPriority(handle, THREAD_PRIORITY_TIME_CRITICAL); 207 ::SetThreadPriority(handle, THREAD_PRIORITY_TIME_CRITICAL);
203 break; 208 break;
204 } 209 }
205 } 210 }
206 211
207 } // namespace base 212 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/platform_thread_posix.cc ('k') | base/threading/sequenced_worker_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698