def handle_sigchld(self, number, frame):
"""Apparently we need a sigchld handler to make set_wakeup_fd work."""
# Write to the signal pipe (only for Python <2.5, where the
# set_wakeup_fd method doesn't exist).
if self.iomap.wakeup_writefd:
os.write(self.iomap.wakeup_writefd, '\0')
for task in self.running:
if task.proc:
task.proc.poll()
# Apparently some UNIX systems automatically reset the SIGCHLD
# handler to SIG_DFL. Reset it just in case.
self.set_sigchld_handler()
评论列表
文章目录