Skip to content
Merged
Prev Previous commit
Next Next commit
move seealso section
  • Loading branch information
samatjain committed Apr 26, 2023
commit 77c155143989b3dc4cb9944a8da9561d8e093f09
11 changes: 6 additions & 5 deletions Doc/library/threading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -604,11 +604,6 @@ and its :meth:`~Lock.release` method to unlock it.
:meth:`~RLock.acquire` and :meth:`~RLock.release`
to handle acquiring and releasing the lock for a block of code.

.. seealso::

:ref:`Using RLock as a context manager <with-locks>` is recommended
over manual :meth:`!acquire` and :meth:`release` calls whenever practical.

RLock's :meth:`~RLock.acquire`/:meth:`~RLock.release` call pairs may be nested,
unlike Lock's :meth:`~Lock.acquire`/:meth:`~Lock.release`. Only the final
:meth:`~RLock.release` (the :meth:`~Lock.release` of the outermost pair) resets
Expand Down Expand Up @@ -636,6 +631,12 @@ call release as many times the lock has been acquired can lead to deadlock.

Acquire a lock, blocking or non-blocking.

.. seealso::

:ref:`Using RLock as a context manager <with-locks>` is recommended
over manual :meth:`!acquire` and :meth:`release` calls whenever practical.
Comment thread
samatjain marked this conversation as resolved.
Outdated


When invoked with the *blocking* argument set to ``True`` (the default):

* If no thread owns the lock, acquire the lock and return immediately.
Expand Down