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

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: Remove old PDT interface in webkit/dom_storage. Created 8 years, 9 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
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 22 matching lines...) Expand all
102 static void SetThreadPriority(PlatformThreadHandle handle, 99 static void SetThreadPriority(PlatformThreadHandle handle,
103 ThreadPriority priority); 100 ThreadPriority priority);
104 101
105 private: 102 private:
106 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread); 103 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread);
107 }; 104 };
108 105
109 } // namespace base 106 } // namespace base
110 107
111 #endif // BASE_THREADING_PLATFORM_THREAD_H_ 108 #endif // BASE_THREADING_PLATFORM_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698