[3.12] gh-109593: Fix reentrancy issue in multiprocessing resource_tracker (GH-109629) (#109898)

gh-109593: Fix reentrancy issue in multiprocessing resource_tracker (GH-109629)

---------

(cherry picked from commit 0eb98837b6)

Co-authored-by: Antoine Pitrou <antoine@python.org>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2023-10-02 08:37:40 -07:00 committed by GitHub
parent 84f9da9ab5
commit b723b8a13d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 95 additions and 2 deletions

View file

@ -238,6 +238,13 @@ class _RLock:
def _is_owned(self):
return self._owner == get_ident()
# Internal method used for reentrancy checks
def _recursion_count(self):
if self._owner != get_ident():
return 0
return self._count
_PyRLock = _RLock