summaryrefslogtreecommitdiffstats
path: root/Lib/threading.py
diff options
context:
space:
mode:
authorAntoine Pitrou <antoine@python.org>2023-09-26 11:57:25 (GMT)
committerGitHub <noreply@github.com>2023-09-26 11:57:25 (GMT)
commit0eb98837b60bc58e57ad3e2b35c6b0e9ab634678 (patch)
tree215ecf809bc7a23493ffd1419db302515c05d377 /Lib/threading.py
parent2897142d2ec0930a8991af964c798b68fb6dcadd (diff)
downloadcpython-0eb98837b60bc58e57ad3e2b35c6b0e9ab634678.zip
cpython-0eb98837b60bc58e57ad3e2b35c6b0e9ab634678.tar.gz
cpython-0eb98837b60bc58e57ad3e2b35c6b0e9ab634678.tar.bz2
gh-109593: Fix reentrancy issue in multiprocessing resource_tracker (#109629)
--------- 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 f6bbdb0..31cefd2 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -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