summaryrefslogtreecommitdiff
path: root/chromium/base/task/common/checked_lock.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/base/task/common/checked_lock.h
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/base/task/common/checked_lock.h')
-rw-r--r--chromium/base/task/common/checked_lock.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/chromium/base/task/common/checked_lock.h b/chromium/base/task/common/checked_lock.h
index 29ce5735b61..4399ec477a5 100644
--- a/chromium/base/task/common/checked_lock.h
+++ b/chromium/base/task/common/checked_lock.h
@@ -31,18 +31,27 @@ namespace internal {
// CheckedLock(const CheckedLock* predecessor)
// Constructor that specifies an allowed predecessor for that lock.
// DCHECKs
-// On Construction if |predecessor| forms a predecessor lock cycle.
+// On Construction if |predecessor| forms a predecessor lock cycle or
+// is a universal successor.
// On Acquisition if the previous lock acquired on the thread is not
// either |predecessor| or a universal predecessor. Okay if there
// was no previous lock acquired.
//
// CheckedLock(UniversalPredecessor universal_predecessor)
// Constructor for a lock that will allow the acquisition of any lock after
-// it, without needing to explicitly be named a predecessor. Can only be
-// acquired if no locks are currently held by this thread.
-// DCHECKs
+// it, without needing to explicitly be named a predecessor (e.g. a root in
+// a lock chain). Can only be acquired if no locks are currently held by
+// this thread. DCHECKs
// On Acquisition if any CheckedLock is acquired on this thread.
//
+// CheckedLock(UniversalSuccessor universal_successor)
+// Constructor for a lock that will allow its acquisition after any other
+// lock, without needing to explicitly name its predecessor (e.g. a leaf in
+// a lock chain). Can not be acquired after another UniversalSuccessor lock.
+// DCHECKs
+// On Acquisition if there was a previously acquired lock on the thread
+// and it was also a universal successor.
+//
// void Acquire()
// Acquires the lock.
//
@@ -63,6 +72,8 @@ class LOCKABLE CheckedLock : public CheckedLockImpl {
: CheckedLockImpl(predecessor) {}
explicit CheckedLock(UniversalPredecessor universal_predecessor)
: CheckedLockImpl(universal_predecessor) {}
+ explicit CheckedLock(UniversalSuccessor universal_successor)
+ : CheckedLockImpl(universal_successor) {}
};
#else // DCHECK_IS_ON()
class LOCKABLE CheckedLock : public Lock {
@@ -70,6 +81,7 @@ class LOCKABLE CheckedLock : public Lock {
CheckedLock() = default;
explicit CheckedLock(const CheckedLock*) {}
explicit CheckedLock(UniversalPredecessor) {}
+ explicit CheckedLock(UniversalSuccessor) {}
static void AssertNoLockHeldOnCurrentThread() {}
std::unique_ptr<ConditionVariable> CreateConditionVariable() {