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

Unified Diff: base/threading/platform_thread.h

Issue 12741012: base: Support setting thread priorities generically. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 7 years, 8 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
Index: base/threading/platform_thread.h
diff --git a/base/threading/platform_thread.h b/base/threading/platform_thread.h
index 576695a4e7b5f8028f47cc5e02921b551ffb0a39..ab897bbda6642653c26068dbcee5c7c1fd337b9e 100644
--- a/base/threading/platform_thread.h
+++ b/base/threading/platform_thread.h
@@ -43,7 +43,11 @@ const PlatformThreadId kInvalidThreadId = 0;
enum ThreadPriority{
kThreadPriority_Normal,
// Suitable for low-latency, glitch-resistant audio.
- kThreadPriority_RealtimeAudio
+ kThreadPriority_RealtimeAudio,
+ // Suitable for threads which generate data for the display (at ~60Hz).
+ kThreadPriority_Display,
+ // Suitable for threads that shouldn't disrupt high priority work.
+ kThreadPriority_Background
};
// A namespace for low-level thread functions.
@@ -106,9 +110,10 @@ class BASE_EXPORT PlatformThread {
// |thread_handle|.
static void Join(PlatformThreadHandle thread_handle);
- // Sets the priority of the thread specified in |handle| to |priority|.
- // This does not work on Linux, use CreateWithPriority() instead.
+ // Only one of the handle/id is required depending on the
+ // platform. However, for cross platform code, pass both.
static void SetThreadPriority(PlatformThreadHandle handle,
+ PlatformThreadId id,
ThreadPriority priority);
private:

Powered by Google App Engine
This is Rietveld 408576698