Lines Matching refs:alarm
42 of execution. Any thread can perform an :func:`alarm`, :func:`getsignal`,
135 .. function:: alarm(time)
138 sent to the process in *time* seconds. Any previously scheduled alarm is
139 canceled (only one alarm can be scheduled at any time). The returned value is
140 then the number of seconds before any previously set alarm was to have been
141 delivered. If *time* is zero, no alarm is scheduled, and any scheduled alarm is
142 canceled. If the return value is zero, no alarm is currently scheduled. (See
143 the Unix man page :manpage:`alarm(2)`.) Availability: Unix.
169 :func:`alarm`) and after that every *interval* seconds. The interval
253 Here is a minimal example program. It uses the :func:`alarm` function to limit
256 :func:`os.open` to hang indefinitely. The solution is to set a 5-second alarm
257 before opening the file; if the operation takes too long, the alarm signal will
266 # Set the signal handler and a 5-second alarm
268 signal.alarm(5)
273 signal.alarm(0) # Disable the alarm