Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-96349: Fix minor performance regression initializing threading.Event #96350

Merged
merged 1 commit into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 3 additions & 9 deletions Lib/threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,12 @@ def __init__(self, lock=None):
# If the lock defines _release_save() and/or _acquire_restore(),
# these override the default implementations (which just call
# release() and acquire() on the lock). Ditto for _is_owned().
try:
if hasattr(lock, '_release_save'):
self._release_save = lock._release_save
except AttributeError:
pass
try:
if hasattr(lock, '_acquire_restore'):
self._acquire_restore = lock._acquire_restore
except AttributeError:
pass
try:
if hasattr(lock, '_is_owned'):
self._is_owned = lock._is_owned
except AttributeError:
pass
self._waiters = _deque()

def _at_fork_reinit(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a minor performance regression in :func:`threading.Event.__init__`