diff options
author | Dong-hee Na <donghee.na92@gmail.com> | 2020-04-14 16:35:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-14 16:35:36 (GMT) |
commit | a5900ecf9f22e65bef489633692e9ea6941379c5 (patch) | |
tree | a4d5df2bbb90bbe501ff2d51ec7afca1392e729d /Lib/multiprocessing/resource_sharer.py | |
parent | e560f90602870601945ea7a4f7770827608817d2 (diff) | |
download | cpython-a5900ecf9f22e65bef489633692e9ea6941379c5.zip cpython-a5900ecf9f22e65bef489633692e9ea6941379c5.tar.gz cpython-a5900ecf9f22e65bef489633692e9ea6941379c5.tar.bz2 |
bpo-40221: Update multiprocessing to use _at_fork_reinit (GH-19511)
Diffstat (limited to 'Lib/multiprocessing/resource_sharer.py')
-rw-r--r-- | Lib/multiprocessing/resource_sharer.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/multiprocessing/resource_sharer.py b/Lib/multiprocessing/resource_sharer.py index 8d5c990..6607650 100644 --- a/Lib/multiprocessing/resource_sharer.py +++ b/Lib/multiprocessing/resource_sharer.py @@ -63,7 +63,6 @@ class _ResourceSharer(object): def __init__(self): self._key = 0 self._cache = {} - self._old_locks = [] self._lock = threading.Lock() self._listener = None self._address = None @@ -113,10 +112,7 @@ class _ResourceSharer(object): for key, (send, close) in self._cache.items(): close() self._cache.clear() - # If self._lock was locked at the time of the fork, it may be broken - # -- see issue 6721. Replace it without letting it be gc'ed. - self._old_locks.append(self._lock) - self._lock = threading.Lock() + self._lock._at_fork_reinit() if self._listener is not None: self._listener.close() self._listener = None |