comparison src/event/ngx_event_timer.h @ 110:dad2fe8ecf08 NGINX_0_3_2

nginx 0.3.2 *) Feature: the Sun Studio 10 C compiler support. *) Feature: the "proxy_upstream_max_fails", "proxy_upstream_fail_timeout", "fastcgi_upstream_max_fails", and "fastcgi_upstream_fail_timeout" directives.
author Igor Sysoev <http://sysoev.ru>
date Wed, 12 Oct 2005 00:00:00 +0400
parents cf3d6edb3ad6
children 408f195b3482
comparison
equal deleted inserted replaced
109:97da525033a1 110:dad2fe8ecf08
58 58
59 59
60 static ngx_inline void 60 static ngx_inline void
61 ngx_event_add_timer(ngx_event_t *ev, ngx_msec_t timer) 61 ngx_event_add_timer(ngx_event_t *ev, ngx_msec_t timer)
62 { 62 {
63 ngx_rbtree_key_t key; 63 ngx_msec_t key;
64 ngx_rbtree_key_int_t diff; 64 ngx_msec_int_t diff;
65 65
66 key = ngx_current_time + timer; 66 key = ngx_current_time + timer;
67 67
68 if (ev->timer_set) { 68 if (ev->timer_set) {
69 69
71 * Use the previous timer value if a difference between them is less 71 * Use the previous timer value if a difference between them is less
72 * then NGX_TIMER_LAZY_DELAY milliseconds. It allows to minimize 72 * then NGX_TIMER_LAZY_DELAY milliseconds. It allows to minimize
73 * the rbtree operations for the fast connections. 73 * the rbtree operations for the fast connections.
74 */ 74 */
75 75
76 diff = (ngx_rbtree_key_int_t) (key - ev->timer.key); 76 diff = (ngx_msec_int_t) (key - ev->timer.key);
77 77
78 if (ngx_abs(diff) < NGX_TIMER_LAZY_DELAY) { 78 if (ngx_abs(diff) < NGX_TIMER_LAZY_DELAY) {
79 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0, 79 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0,
80 "event timer: %d, old: %M, new: %M", 80 "event timer: %d, old: %M, new: %M",
81 ngx_event_ident(ev->data), ev->timer.key, key); 81 ngx_event_ident(ev->data), ev->timer.key, key);