t
表示tiny,
turbo, 或throttlingtypedef union {
void* p;
int i;
long l;
} ClientData;
void
TimerProc( ClientData client_data, struct timeval* nowP )
。函数将在定时器超时时调用typedef struct TimerStruct {
TimerProc* timer_proc;
ClientData client_data;
long msecs;
int periodic;
struct timeval time;
struct TimerStruct* prev;
struct TimerStruct* next;
int hash;
} Timer;
void tmr_init(
void )
Timer*
tmr_create( struct timeval* nowP, TimerProc* timer_proc, ClientData client_data, long msecs, int periodic )
timeval*
tmr_timeout( struct timeval* nowP )
tmr_mstimeout(
struct timeval* nowP )
void tmr_run(
struct timeval* nowP )
void tmr_reset(
struct timeval* nowP, Timer* timer )
void tmr_cancel(
Timer* timer )
void tmr_cleanup(
void )
void tmr_destroy(
void )
void tmr_logstats(
long secs )
(time.tv_sec
^ time.tv_usec) % 67
得到hash值
thttpd源码解析 定时器模块,布布扣,bubuko.com
原文地址:http://blog.csdn.net/caozhk/article/details/38491045