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

Unified Diff: base/synchronization/lock.h

Issue 2206263002: Add Lock::HandlesMultipleThreadPriorities(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/synchronization/lock.h
diff --git a/base/synchronization/lock.h b/base/synchronization/lock.h
index c2680cbcc8a145be5ce3556a76e071e595997d7a..64df37d0f2c2edce7f8592a1811ac0e0f6a0d3c2 100644
--- a/base/synchronization/lock.h
+++ b/base/synchronization/lock.h
@@ -61,13 +61,15 @@ class BASE_EXPORT Lock {
void AssertAcquired() const;
#endif // DCHECK_IS_ON()
+ // Whether it is safe to use a Lock from different thread priorities (i.e.
+ // there won't be priority inversion for an extended period of time).
+ static bool IsSafeWithMultipleThreadPriorities() {
robliao 2016/08/03 18:02:10 I would go with HandlesMultipleThreadPriorities. S
fdoray 2016/08/03 18:34:48 Done.
#if defined(OS_POSIX)
- // Whether this platform has priority inheritance available. All locks will
- // attempt to use the priority inheritance version if available.
- static bool PriorityInheritanceAvailable() {
return internal::LockImpl::PriorityInheritanceAvailable();
- }
+#else
+ return true;
gab 2016/08/03 18:04:57 Add a comment about why that's true on Windows (su
fdoray 2016/08/03 18:34:48 Done.
#endif
+ }
#if defined(OS_POSIX) || defined(OS_WIN)
// Both Windows and POSIX implementations of ConditionVariable need to be
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698