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

Conversation

jderusse
Copy link
Member

@jderusse jderusse commented Dec 7, 2017

No description provided.

@xabbuh xabbuh added this to the 3.4 milestone Jan 2, 2018
@xabbuh xabbuh added the Lock label Jan 2, 2018
@@ -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``.

@javiereguiluz
Copy link
Member

Thanks Jérémy.

@javiereguiluz javiereguiluz merged commit beb9a6e into symfony:3.4 Jan 5, 2018
javiereguiluz added a commit that referenced this pull request Jan 5, 2018
This PR was merged into the 3.4 branch.

Discussion
----------

[Lock] Add an auto release tips

Commits
-------

beb9a6e Reword
69bdba4 Add the auto release tips
@jderusse jderusse deleted the lock-auto-destruct branch April 18, 2020 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants