标签:remove timeout timers center upd malloc set 用户 文件流
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值
标签:remove timeout timers center upd malloc set 用户 文件流
原文地址:http://www.cnblogs.com/liguangsunls/p/6800504.html