You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 23, 2017. It is now read-only.
Hi,
I noticied a race condition on FreeBSD when handling signals in asyncio when
the Python main thread and a C thread are running at the "same time":
http://bugs.python.org/issue21645
I propose to not rely on signal.signal() to call
_UnixSelectorEventLoop._handle_signal(), but use instead bytes written into the
"wakeup fd" which is the loop "self" pipe.
Patch:
http://codereview.appspot.com/113160044
The patch changes the design of signal handling to fix the race condition:
1. C signal handler writes a byte in the "self" pipe
2. The event loop is awaken, reads its "self" pipe and schedules the call to
the final signal handler
3. The signal handler is called
Original issue reported on code.google.com by victor.s...@gmail.com on 16 Jul 2014 at 3:52