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

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-09-26 05:21:52 -07:00 committed by GitHub
parent bda6949e86
commit f764abb375
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 95 additions and 2 deletions

View file

@ -218,6 +218,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