3 /*=========================================================================*\
4 * Timeout management functions
6 \*=========================================================================*/
9 /* timeout control structure */
10 typedef struct t_timeout_
{
11 double block
; /* maximum time for blocking calls */
12 double total
; /* total number of miliseconds for operation */
13 double start
; /* time of start of operation */
15 typedef t_timeout
*p_timeout
;
17 int timeout_open(lua_State
*L
);
18 void timeout_init(p_timeout tm
, double block
, double total
);
19 double timeout_get(p_timeout tm
);
20 double timeout_getretry(p_timeout tm
);
21 p_timeout
timeout_markstart(p_timeout tm
);
22 double timeout_getstart(p_timeout tm
);
23 double timeout_gettime(void);
24 int timeout_meth_settimeout(lua_State
*L
, p_timeout tm
);
26 #define timeout_iszero(tm) ((tm)->block == 0.0)
28 #endif /* TIMEOUT_H */