Utils: Fix Guard documentation

Change-Id: I18a23c4410424f3799b9ec5bcacccac742713c63
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Orgad Shaneh
2016-10-22 20:40:35 +03:00
committed by Orgad Shaneh
parent d6c8a97429
commit 631211f7e2

View File

@@ -54,8 +54,8 @@
void MyClass::updateOtherObject() void MyClass::updateOtherObject()
{ {
GuardLocker updatelocker(updateGuard); GuardLocker updatelocker(updateGuard);
otherObject->update(); // this may trigger a signal otherObject->update(); // this may trigger a signal
} }
\endcode \endcode
@@ -66,16 +66,16 @@
\code \code
void MyClass::otherObjectUpdated() void MyClass::otherObjectUpdated()
{ {
if (updateGuard.isLocked) if (updateGuard.isLocked())
return; return;
// we didn't trigger the update // we didn't trigger the update
// so do update now // so do update now
\dots \dots
} }
\endcode \endcode
The GuardLock unlocks the Guard in it's destructor. The GuardLocker unlocks the Guard in its destructor.
The Guard object is recursive, you may declare many GuardLocker The Guard object is recursive, you may declare many GuardLocker
objects for the same Guard instance and the Guard will be locked objects for the same Guard instance and the Guard will be locked