GH-100363: Speed up asyncio.get_running_loop (#100364)

This commit is contained in:
Kumar Aditya 2022-12-21 15:19:44 +05:30 committed by GitHub
parent 79311cbfe7
commit 4994f2488f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 118 deletions

View file

@ -836,6 +836,7 @@ if hasattr(os, 'fork'):
# Reset the loop and wakeupfd in the forked child process.
if _event_loop_policy is not None:
_event_loop_policy._local = BaseDefaultEventLoopPolicy._Local()
_set_running_loop(None)
signal.set_wakeup_fd(-1)
os.register_at_fork(after_in_child=on_fork)