mirror of
https://github.com/python/cpython.git
synced 2025-08-28 12:45:07 +00:00
[3.13] gh-125679: multiprocessing Lock and RLock - fix invalid representation string on MacOSX. (GH-125680) (#126533)
gh-125679: multiprocessing Lock and RLock - fix invalid representation string on MacOSX. (GH-125680)
(cherry picked from commit 75f7cf91ec
)
Co-authored-by: Duprat <yduprat@gmail.com>
This commit is contained in:
parent
07a6aa3f8f
commit
3b05ef10c1
3 changed files with 126 additions and 2 deletions
|
@ -174,7 +174,7 @@ class Lock(SemLock):
|
|||
name = process.current_process().name
|
||||
if threading.current_thread().name != 'MainThread':
|
||||
name += '|' + threading.current_thread().name
|
||||
elif self._semlock._get_value() == 1:
|
||||
elif not self._semlock._is_zero():
|
||||
name = 'None'
|
||||
elif self._semlock._count() > 0:
|
||||
name = 'SomeOtherThread'
|
||||
|
@ -200,7 +200,7 @@ class RLock(SemLock):
|
|||
if threading.current_thread().name != 'MainThread':
|
||||
name += '|' + threading.current_thread().name
|
||||
count = self._semlock._count()
|
||||
elif self._semlock._get_value() == 1:
|
||||
elif not self._semlock._is_zero():
|
||||
name, count = 'None', 0
|
||||
elif self._semlock._count() > 0:
|
||||
name, count = 'SomeOtherThread', 'nonzero'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue