mirror of
https://github.com/python/cpython
synced 2024-09-04 15:56:13 +00:00
gh-96349: fix minor performance regression initializing threading.Event (gh-96350)
This commit is contained in:
parent
b17aae8bbd
commit
22ed5233b7
|
@ -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):
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Fixed a minor performance regression in :func:`threading.Event.__init__`
|
Loading…
Reference in a new issue