summaryrefslogtreecommitdiffstats
path: root/Lib/threading.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-09-26 12:21:52 (GMT)
committerGitHub <noreply@github.com>2023-09-26 12:21:52 (GMT)
commitf764abb3752574f8f4c2d6fd2ed3aa1346fd2aee (patch)
tree440eba8d3a1aac0769493b1437b8ec4eb50c9a94 /Lib/threading.py
parentbda6949e860227873432dd1e3732127f5835baed (diff)
downloadcpython-f764abb3752574f8f4c2d6fd2ed3aa1346fd2aee.zip
cpython-f764abb3752574f8f4c2d6fd2ed3aa1346fd2aee.tar.gz
cpython-f764abb3752574f8f4c2d6fd2ed3aa1346fd2aee.tar.bz2
[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 0eb98837b60bc58e57ad3e2b35c6b0e9ab634678) Co-authored-by: Antoine Pitrou <antoine@python.org> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Diffstat (limited to 'Lib/threading.py')
-rw-r--r--Lib/threading.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/threading.py b/Lib/threading.py
index 4f72938..70601fc 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -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