forked from qt-creator/qt-creator
Guard: Make it possible to lock/unlock manually
Use it in some KitAspectWidget subclasses. Change-Id: Ie683d5af6a44d0042456418af729a3d718396803 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -97,6 +97,17 @@ bool Guard::isLocked() const
|
||||
return m_lockCount;
|
||||
}
|
||||
|
||||
void Guard::lock()
|
||||
{
|
||||
++m_lockCount;
|
||||
}
|
||||
|
||||
void Guard::unlock()
|
||||
{
|
||||
QTC_CHECK(m_lockCount > 0);
|
||||
--m_lockCount;
|
||||
}
|
||||
|
||||
GuardLocker::GuardLocker(Guard &guard)
|
||||
: m_guard(guard)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user