summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na92@gmail.com>2020-04-14 13:15:52 (GMT)
committerGitHub <noreply@github.com>2020-04-14 13:15:52 (GMT)
commite1945307d36849f8be8937144cf3dd6ebab6274c (patch)
tree21c038fcb8ae6f9c338667ad1d4938c535b23f3a
parent81a7be3fa22c983209cc0ffb3537b92b0370f83c (diff)
downloadcpython-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.py8
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__()