diff options
author | Dong-hee Na <donghee.na92@gmail.com> | 2020-04-14 13:15:52 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-14 13:15:52 (GMT) |
commit | e1945307d36849f8be8937144cf3dd6ebab6274c (patch) | |
tree | 21c038fcb8ae6f9c338667ad1d4938c535b23f3a | |
parent | 81a7be3fa22c983209cc0ffb3537b92b0370f83c (diff) | |
download | cpython-e1945307d36849f8be8937144cf3dd6ebab6274c.zip cpython-e1945307d36849f8be8937144cf3dd6ebab6274c.tar.gz cpython-e1945307d36849f8be8937144cf3dd6ebab6274c.tar.bz2 |
bpo-40221: Update multiprocessing to use _at_fork_reinit (GH-19477)
-rw-r--r-- | Lib/multiprocessing/util.py | 8 |
1 files 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__() |