block_timers, unblock_timers

block_timers, unblock_timers — block and unblock timer firing.

Syntax

block_timers ()
unblock_timers ()

		

Arguments

none

Returns

t

Description

Timers are potentially handled by a different mechanism from operating system signals. It may be desirable to block all timers from firing for the duration of an operation, which may not be possible using the block_signal mechanism. If a timer fires while timers are blocked, the timer function will be called as soon as timers are unblocked. This will not delay subsequent timers.

For example, if a timer is intended to fire every 5 seconds at 5, 10, ... seconds after the minute and the 5-second timer is blocked until second 7, the next timer in the sequence will still fire at 10 seconds. If the 5-second timer were blocked until second 27, then the 5, 10, 15, 20 and 25-second timers would all fire at second 27 and the next timer would fire at second 30. Code which blocks timers should be surrounded by a call to unwind_protect.

Example

Gamma> block_timers();
t
Gamma> protected_function();
<function return>
Gamma> unblock_timers();
t
		

See Also

block_signal, unblock_signal, after, at, every, _timers_ in Predefined Symbosl