Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Lib/multiprocessing/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,13 @@ def _exit_function(info=info, debug=debug, _run_finalizers=_run_finalizers,

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__()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update ForkAwareThreadLock to use _at_fork_reinit.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For such news entry, you should mention which module is modified. The user reading the NEWS entry has no idea, except maybe multiprocessing experts ;-)

For this specific change, honestly, I don't think that end users really care: I suggest to remove the NEWS entry. The change doesn't seem to fix any known crash, it's more a cleanup/refactoring.