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

Unified Diff: base/threading/platform_thread.h

Issue 1006933003: Add full SetThreadPriority support to Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweaks Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/threading/platform_thread_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/platform_thread.h
diff --git a/base/threading/platform_thread.h b/base/threading/platform_thread.h
index 28743145610c70fe14f8c8fdd1e377a9aa861528..f90a9a2ec17d51c04cfc129fcde1013e118ff7fd 100644
--- a/base/threading/platform_thread.h
+++ b/base/threading/platform_thread.h
@@ -111,7 +111,7 @@ class PlatformThreadHandle {
const PlatformThreadId kInvalidThreadId(0);
// Valid values for SetThreadPriority()
-enum ThreadPriority{
+enum ThreadPriority {
kThreadPriority_Normal,
// Suitable for low-latency, glitch-resistant audio.
kThreadPriority_RealtimeAudio,
@@ -141,7 +141,10 @@ class BASE_EXPORT PlatformThread {
// we're on the right thread quickly.
static PlatformThreadRef CurrentRef();
- // Get the current handle.
+ // Get the handle representing the current thread. On Windows, this is a
+ // pseudo handle constant which will always represent the thread using it and
+ // hence should not be shared with other threads nor be used to differentiate
+ // the current thread from another.
static PlatformThreadHandle CurrentHandle();
// Yield the current thread so another thread can be scheduled.
@@ -171,9 +174,7 @@ class BASE_EXPORT PlatformThread {
// CreateWithPriority() does the same thing as Create() except the priority of
// the thread is set based on |priority|. Can be used in place of Create()
- // followed by SetThreadPriority(). SetThreadPriority() has not been
- // implemented on the Linux platform yet, this is the only way to get a high
- // priority thread on Linux.
+ // followed by SetThreadPriority().
static bool CreateWithPriority(size_t stack_size, Delegate* delegate,
PlatformThreadHandle* thread_handle,
ThreadPriority priority);
@@ -191,6 +192,8 @@ class BASE_EXPORT PlatformThread {
static void SetThreadPriority(PlatformThreadHandle handle,
ThreadPriority priority);
+ static ThreadPriority GetThreadPriority(PlatformThreadHandle handle);
+
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread);
};
« no previous file with comments | « no previous file | base/threading/platform_thread_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698