Files
bitchx/include/timer.h
Kevin Easton c0c7cdbdcc Rework the calculation of the select timeout in io() to be based on absolute wake time
An absolute wake time is now calculated and updated by set_server_bits(),
TimerTimeout() and tclTimerTimeout().  This is then used to calculate the actual
select() timeout, instead of having those functions calculate a relative timeout
value themselves.  This significantly simplifies those functions, since the
underlying values tend to be recorded as absolute times.

It also allows us to disentangle tclTimeTimeout from TimerTimeout(), and move the
responsibility for calculating the QUEUE_SENDS wake time from TimerTimeout() to
set_server_bits() where it belongs.

The QUEUE_SENDS and CONNECT_DELAY wake up times will also now be correctly
calculated, based on the last sent time and connect time respectively.
2015-06-07 00:03:09 +10:00

25 lines
788 B
C

/*
* timer.h: header for timer.c
* See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT
*/
#ifndef _TIMER_H_
#define _TIMER_H_
/* functions that may be called by others */
extern void timercmd (char *, char *, char *, char *);
extern void ExecuteTimers (void);
extern char *BX_add_timer (int, char *, double, long, int (*) (void *, char *), char *, char *, int, char *);
extern int BX_delete_timer (char *);
extern int get_delete_timer(char *);
extern int kill_timer(char *);
extern void BX_delete_all_timers (void);
extern int timer_exists (char *ref);
void TimerTimeout(struct timeval *wake_time);
char *tcl_add_timer (TimerList **, long, char *, unsigned long);
int tcl_remove_timer (TimerList **, unsigned long);
int timer_callback_exists(void *);
#endif /* _TIMER_H_ */