Skip to content

[Lock] Add an auto release tips #8845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 5, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions components/lock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would reword the paragraph a bit:

.. tip::
    While it's recommended to release the lock as soon as it is no longer
    required, it will automatically be released 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``.

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
--------------

Expand Down