summaryrefslogtreecommitdiffstats
path: root/Lib/threading.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-10-02 15:37:40 (GMT)
committerGitHub <noreply@github.com>2023-10-02 15:37:40 (GMT)
commitb723b8a13d6b74b0fa1bf89149f314e26a93be9d (patch)
tree2134501782dd3a2ca3deb26e5efefd852306a744 /Lib/threading.py
parent84f9da9ab52e476224baac8786ab104e80ff77ba (diff)
downloadcpython-b723b8a13d6b74b0fa1bf89149f314e26a93be9d.zip
cpython-b723b8a13d6b74b0fa1bf89149f314e26a93be9d.tar.gz
cpython-b723b8a13d6b74b0fa1bf89149f314e26a93be9d.tar.bz2
[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 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 df27387..a746dee 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -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