Commit 631211f7 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Utils: Fix Guard documentation

Change-Id: I18a23c4410424f3799b9ec5bcacccac742713c63
Reviewed-by: Jaroslaw Kobus's avatarJarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Riitta-Leena Miettinen's avatarLeena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent d6c8a974
...@@ -54,8 +54,8 @@ ...@@ -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 @@ ...@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment