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

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
This commit is contained in:
Antoine Pitrou 2023-09-26 13:57:25 +02:00 committed by GitHub
parent 2897142d2e
commit 0eb98837b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 95 additions and 2 deletions

View file

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