Next: Debug and user interface
Up: Available routines in the
Previous: Message and queue manipulation
  Contents
Timer manipulation
- NAMES
- :
start_timer, stop_timer, stop_timers, is_timer, is_a_timer - Timer Handling.
- SYNTAX
- :
start_timer( int t, int s )
stop_timer( int t )
stop_timers()
int is_timer()
int is_a_timer( int t )
- DESCRIPTION
- :
- start_timer starts timer t of current node me and schedules it to time-out after s steps of node me. It adds the product of PCB[me].step and s to the current time TIME to compute the time for timeout. start_timer puts that value in PCB[me].clock[t].value and schedules the corresponding event TIMEOUT_1, TIMEOUT_2, ..., TIMEOUT_5, depending on the timer number t.
The value of t can have any of the predefined values TIMER1, TIMER2, ..., TIMER5.
- stop_timer stops timer t of current node me i.e. sets the PCB[me].clock[t].value to the predefined value NOT_STARTED. stop_timer also, cancels the event of corresponding timeout.
- stop_timers stops all the timers of current node me in the way stop_timer does.
- is_timer returns TRUE if there is a timer active in current node me, else returns FALSE.
- is_a_timer returns TRUE if timer t is active in current node me, else returns FALSE.
- DIAGNOSTICS
- stop_timer and stop_timers print error message and stop execution if there is a timer active and no corresponding event found or event found but corresponding timer is inactive.
SEE ALSO: System Structure (Section 5.2) and Timers.h.
Next: Debug and user interface
Up: Available routines in the
Previous: Message and queue manipulation
  Contents
Ha Hoai Phuong
2002-11-11