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

Unified Diff: base/threading/platform_thread_freebsd.cc

Issue 1006933003: Add full SetThreadPriority support to Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: base/threading/platform_thread_freebsd.cc
diff --git a/base/threading/platform_thread_freebsd.cc b/base/threading/platform_thread_freebsd.cc
index a163f650443d08f1602ff295e8c985dab7c7ddd2..6de2e2b3a3ec02f2b53d9441c1b156813955be32 100644
--- a/base/threading/platform_thread_freebsd.cc
+++ b/base/threading/platform_thread_freebsd.cc
@@ -46,6 +46,23 @@ bool HandleSetThreadPriorityForPlatform(PlatformThreadHandle handle,
#endif
}
+bool HandleGetThreadPriorityForPlatform(PlatformThreadHandle handle,
+ ThreadPriority* priority) {
+#if !defined(OS_NACL)
+ // Mirrors HandleSetThreadPriorityForPlatform()'s implementation.
rvargas (doing something else) 2015/03/19 22:19:21 Do we need this comment?
gab 2015/03/30 20:14:45 I like it, if anything it answers your question be
rvargas (doing something else) 2015/03/30 22:31:22 It doesn't answer my question :p. I noticed you we
+ int maybe_sched_rr = 0;
+ struct sched_param maybe_realtime_prio = {0};
+ if (pthread_getschedparam(pthread_self(), &maybe_sched_rr,
rvargas (doing something else) 2015/03/19 22:19:21 why self() and not handle?
gab 2015/03/30 20:14:45 Because it mirrors HandleSetThreadPriorityForPlatf
rvargas (doing something else) 2015/03/30 22:31:22 I don't think that's a strong enough justification
gab 2015/03/31 14:02:33 Added a TODO, will find an owner once this lands.
+ &maybe_realtime_prio) == 0 &&
+ maybe_sched_rr == SCHED_RR &&
+ maybe_realtime_prio.sched_priority == kRealTimePrio.sched_priority) {
+ *priority = kThreadPriority_RealtimeAudio;
+ return true;
+ }
+#endif
+ return false;
+}
+
} // namespace internal
// static

Powered by Google App Engine
This is Rietveld 408576698