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

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

Issue 9703053: Remove old Sleep and PostDelayedTask interfaces that use int ms instead of TimeDelta. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase onto master. 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
« 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
118 void PlatformThread::Sleep(TimeDelta duration) { 113 void PlatformThread::Sleep(TimeDelta duration) {
119 ::Sleep(duration.InMillisecondsRoundedUp()); 114 ::Sleep(duration.InMillisecondsRoundedUp());
120 } 115 }
121 116
122 // static 117 // static
123 void PlatformThread::SetName(const char* name) { 118 void PlatformThread::SetName(const char* name) {
124 current_thread_name.Set(const_cast<char*>(name)); 119 current_thread_name.Set(const_cast<char*>(name));
125 120
126 // On Windows only, we don't need to tell the profiler about the "BrokerEvent" 121 // On Windows only, we don't need to tell the profiler about the "BrokerEvent"
127 // thread, as it exists only in the chrome.exe image, and never spawns or runs 122 // 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
203 case kThreadPriority_Normal: 198 case kThreadPriority_Normal:
204 ::SetThreadPriority(handle, THREAD_PRIORITY_NORMAL); 199 ::SetThreadPriority(handle, THREAD_PRIORITY_NORMAL);
205 break; 200 break;
206 case kThreadPriority_RealtimeAudio: 201 case kThreadPriority_RealtimeAudio:
207 ::SetThreadPriority(handle, THREAD_PRIORITY_TIME_CRITICAL); 202 ::SetThreadPriority(handle, THREAD_PRIORITY_TIME_CRITICAL);
208 break; 203 break;
209 } 204 }
210 } 205 }
211 206
212 } // namespace base 207 } // 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