Lines Matching refs:signal

1 """Selector event loop for Unix with signal handling."""
8 import signal
43 """Dummy signal handler."""
60 Adds signal handling and UNIX Domain Socket support to SelectorEventLoop.
76 f"stage, skipping signal handlers removal",
89 """Add a handler for a signal. UNIX only.
91 Raise ValueError if the signal number is invalid or uncatchable.
103 # event loop running in another thread cannot add a signal
105 signal.set_wakeup_fd(self._csock.fileno())
113 # Register a dummy signal handler to ask Python to write the signal
115 # read signal numbers from this file descriptor to handle signals.
116 signal.signal(sig, _sighandler_noop)
119 signal.siginterrupt(sig, False)
124 signal.set_wakeup_fd(-1)
134 """Internal helper that is the actual signal handler."""
144 """Remove a handler for a signal. UNIX only.
146 Return True if a signal handler was removed, False if not.
154 if sig == signal.SIGINT:
155 handler = signal.default_int_handler
157 handler = signal.SIG_DFL
160 signal.signal(sig, handler)
169 signal.set_wakeup_fd(-1)
176 """Internal helper to validate a signal.
178 Raise ValueError if the signal number is invalid or uncatchable.
184 if sig not in signal.valid_signals():
185 raise ValueError(f'invalid signal number {sig}')
835 report their termination or interruption by a signal.
850 Since child watcher objects may catch the SIGCHLD signal and call
1016 self._loop.remove_signal_handler(signal.SIGCHLD)
1020 loop.add_signal_handler(signal.SIGCHLD, self._sig_chld)
1033 # as '_sig_chld' is added as a signal handler
1178 # Because of signal coalescing, we must keep calling waitpid() as
1223 This implementation registers a SIGCHLD signal handler on
1225 install own handler for this signal).
1251 handler = signal.getsignal(signal.SIGCHLD)
1255 signal.signal(signal.SIGCHLD, self._saved_sighandler)
1282 # Main thread is required for subscription on SIGCHLD signal
1286 self._saved_sighandler = signal.signal(signal.SIGCHLD, self._sig_chld)
1290 self._saved_sighandler = signal.SIG_DFL
1293 signal.siginterrupt(signal.SIGCHLD, False)
1351 It doesn't require subscription on POSIX signal