aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/guard.h
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2022-07-22 11:54:45 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2022-07-22 12:02:19 +0000
commit063efbe693993e612e4f88e365dc380748b6e970 (patch)
tree9f8f645f20bdcdbd091cf01ca9ad334e8fedec4f /src/libs/utils/guard.h
parent3f05594db1b3661a337c262662af191693cf4dfd (diff)
Guard: Make it possible to lock/unlock manually
Use it in some KitAspectWidget subclasses. Change-Id: Ie683d5af6a44d0042456418af729a3d718396803 Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/libs/utils/guard.h')
-rw-r--r--src/libs/utils/guard.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libs/utils/guard.h b/src/libs/utils/guard.h
index 2f986d82b06..7a0ddbf5c53 100644
--- a/src/libs/utils/guard.h
+++ b/src/libs/utils/guard.h
@@ -38,6 +38,12 @@ public:
Guard();
~Guard();
bool isLocked() const;
+
+ // Prefer using GuardLocker when possible. These two methods are provided only for cases
+ // when locking and unlocking are done in separate methods, so that GuardLocker can't be
+ // used.
+ void lock();
+ void unlock();
private:
int m_lockCount = 0;
friend class GuardLocker;