From 69bdba4fbd983588168f27c210f791039e4c2115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Thu, 23 Mar 2017 22:13:13 +0100 Subject: [PATCH 1/2] Add the auto release tips --- components/lock.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/lock.rst b/components/lock.rst index ce8c2044999..cb9f3f92bfc 100644 --- a/components/lock.rst +++ b/components/lock.rst @@ -62,6 +62,13 @@ method can be safely called repeatedly, even if the lock is already acquired. to be used by several services, they should share the same ``Lock`` instance returned by the ``Factory::createLock`` method. +.. tip:: + While it's recommended to release the ``Lock`` as soon as it is no longer + required, the ``Lock`` will automatically be ``released`` on instance + destruction. In some case, it can be usefull to lock a resource across several + requests. To disable the automatic release behavior, set the third argument + of the ``createLock()`` method to ``false``. + Blocking Locks -------------- From beb9a6efde846d408438875c436bd1fba6715fcc Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 5 Jan 2018 10:37:04 +0100 Subject: [PATCH 2/2] Reword --- components/lock.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/lock.rst b/components/lock.rst index cb9f3f92bfc..27a0cb4b7d1 100644 --- a/components/lock.rst +++ b/components/lock.rst @@ -63,11 +63,11 @@ method can be safely called repeatedly, even if the lock is already acquired. returned by the ``Factory::createLock`` method. .. tip:: - While it's recommended to release the ``Lock`` as soon as it is no longer - required, the ``Lock`` will automatically be ``released`` on instance - destruction. In some case, it can be usefull to lock a resource across several - requests. To disable the automatic release behavior, set the third argument - of the ``createLock()`` method to ``false``. + + If you don't release the lock explicitly, it will be released automatically + on instance destruction. In some cases, it can be useful to lock a resource + across several requests. To disable the automatic release behavior, set the + third argument of the ``createLock()`` method to ``false``. Blocking Locks --------------