home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / lan / soss.arj / INCLUDE / TIMER.H < prev    next >
C/C++ Source or Header  |  1991-04-11  |  948b  |  34 lines

  1. /* Copyright 1986 by Carnegie Mellon */
  2. /*  Copyright 1983 by the Massachusetts Institute of Technology  */
  3.  
  4. /* timer.h */
  5.  
  6.  
  7. /* This file contains the declarations for the timer management package. */
  8.  
  9. #define    TPS     18            /*  Clock  ticks per second.  */
  10.  
  11. typedef    unsigned    nonce;        /* a timeout nonce */
  12.  
  13. typedef    struct    timer    {        /* a timer */
  14.     struct    q_elt    tm_elt;        /* next element in lwa-queue */
  15.     long        tm_time;    /* time the timer expires */
  16.     nonce        tm_nonce;    /* nonce for this timer */
  17.     int        (*tm_subr) ();    /* subroutine to call on timeout */
  18.     char        *tm_arg;    /* arg to pass to subr */
  19. } timer;
  20.  
  21. typedef    struct    time_q    {        /* the lwa-queue of active timers */
  22.     timer    *tmq_head;        /* head of the timer lwa-queue */
  23.     timer    *tmq_tail;        /* tail of the timer lwa-queue */
  24.     int    tmq_len;        /* number of elements in lwa-queue */
  25.     unsigned tmq_max;
  26.     unsigned tmq_min;
  27.     } time_q;
  28.  
  29.  
  30. timer *tm_alloc();
  31.  
  32. extern unsigned TIMERDEBUG;
  33.  
  34.