From e1945307d36849f8be8937144cf3dd6ebab6274c Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Tue, 14 Apr 2020 22:15:52 +0900 Subject: bpo-40221: Update multiprocessing to use _at_fork_reinit (GH-19477) --- Lib/multiprocessing/util.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/multiprocessing/util.py b/Lib/multiprocessing/util.py index 32c7a96..21f2a7e 100644 --- a/Lib/multiprocessing/util.py +++ b/Lib/multiprocessing/util.py @@ -367,13 +367,13 @@ atexit.register(_exit_function) class ForkAwareThreadLock(object): def __init__(self): - self._reset() - register_after_fork(self, ForkAwareThreadLock._reset) - - def _reset(self): self._lock = threading.Lock() self.acquire = self._lock.acquire self.release = self._lock.release + register_after_fork(self, ForkAwareThreadLock._at_fork_reinit) + + def _at_fork_reinit(self): + self._lock._at_fork_reinit() def __enter__(self): return self._lock.__enter__() -- cgit v0.12