block_timers () unblock_timers ()
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.
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.