Skip to content

Commit 69bdba4

Browse files
committed
Add the auto release tips
1 parent a5d47c6 commit 69bdba4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

components/lock.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ method can be safely called repeatedly, even if the lock is already acquired.
6262
to be used by several services, they should share the same ``Lock`` instance
6363
returned by the ``Factory::createLock`` method.
6464

65+
.. tip::
66+
While it's recommended to release the ``Lock`` as soon as it is no longer
67+
required, the ``Lock`` will automatically be ``released`` on instance
68+
destruction. In some case, it can be usefull to lock a resource across several
69+
requests. To disable the automatic release behavior, set the third argument
70+
of the ``createLock()`` method to ``false``.
71+
6572
Blocking Locks
6673
--------------
6774

0 commit comments

Comments
 (0)