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

Side by Side Diff: base/threading/platform_thread.h

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/task_runner.cc ('k') | base/threading/platform_thread_posix.cc » ('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 // WARNING: You should *NOT* be using this class directly. PlatformThread is 5 // WARNING: You should *NOT* be using this class directly. PlatformThread is
6 // the low-level platform-specific abstraction to the OS's threading interface. 6 // the low-level platform-specific abstraction to the OS's threading interface.
7 // You should instead be using a message-loop driven Thread, see thread.h. 7 // You should instead be using a message-loop driven Thread, see thread.h.
8 8
9 #ifndef BASE_THREADING_PLATFORM_THREAD_H_ 9 #ifndef BASE_THREADING_PLATFORM_THREAD_H_
10 #define BASE_THREADING_PLATFORM_THREAD_H_ 10 #define BASE_THREADING_PLATFORM_THREAD_H_
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 virtual ~Delegate() {} 57 virtual ~Delegate() {}
58 virtual void ThreadMain() = 0; 58 virtual void ThreadMain() = 0;
59 }; 59 };
60 60
61 // Gets the current thread id, which may be useful for logging purposes. 61 // Gets the current thread id, which may be useful for logging purposes.
62 static PlatformThreadId CurrentId(); 62 static PlatformThreadId CurrentId();
63 63
64 // Yield the current thread so another thread can be scheduled. 64 // Yield the current thread so another thread can be scheduled.
65 static void YieldCurrentThread(); 65 static void YieldCurrentThread();
66 66
67 // Sleeps for the specified duration (units are milliseconds).
68 static void Sleep(int duration_ms);
69
70 // Sleeps for the specified duration. 67 // Sleeps for the specified duration.
71 static void Sleep(base::TimeDelta duration); 68 static void Sleep(base::TimeDelta duration);
72 69
73 // Sets the thread name visible to debuggers/tools. This has no effect 70 // Sets the thread name visible to debuggers/tools. This has no effect
74 // otherwise. This name pointer is not copied internally. Thus, it must stay 71 // otherwise. This name pointer is not copied internally. Thus, it must stay
75 // valid until the thread ends. 72 // valid until the thread ends.
76 static void SetName(const char* name); 73 static void SetName(const char* name);
77 74
78 // Gets the thread name, if previously set by SetName. 75 // Gets the thread name, if previously set by SetName.
79 static const char* GetName(); 76 static const char* GetName();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 static void SetThreadPriority(PlatformThreadHandle handle, 110 static void SetThreadPriority(PlatformThreadHandle handle,
114 ThreadPriority priority); 111 ThreadPriority priority);
115 112
116 private: 113 private:
117 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread); 114 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread);
118 }; 115 };
119 116
120 } // namespace base 117 } // namespace base
121 118
122 #endif // BASE_THREADING_PLATFORM_THREAD_H_ 119 #endif // BASE_THREADING_PLATFORM_THREAD_H_
OLDNEW
« no previous file with comments | « base/task_runner.cc ('k') | base/threading/platform_thread_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698