Mercurial > hg > nginx
comparison src/event/ngx_event_timer.h @ 272:d4e65d74db9f
nginx-0.0.2-2004-03-01-00:03:02 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 29 Feb 2004 21:03:02 +0000 |
parents | 7bb9562216ce |
children | b836469c37c3 |
comparison
equal
deleted
inserted
replaced
271:e16dfb9b9afa | 272:d4e65d74db9f |
---|---|
29 #if (NGX_THREADS) | 29 #if (NGX_THREADS) |
30 extern ngx_mutex_t *ngx_event_timer_mutex; | 30 extern ngx_mutex_t *ngx_event_timer_mutex; |
31 #endif | 31 #endif |
32 | 32 |
33 | 33 |
34 extern ngx_rbtree_t *ngx_event_timer_rbtree; | 34 extern volatile ngx_rbtree_t *ngx_event_timer_rbtree; |
35 extern ngx_rbtree_t ngx_event_timer_sentinel; | 35 extern ngx_rbtree_t ngx_event_timer_sentinel; |
36 | 36 |
37 | 37 |
38 ngx_inline static void ngx_event_del_timer(ngx_event_t *ev) | 38 ngx_inline static void ngx_event_del_timer(ngx_event_t *ev) |
39 { | 39 { |
40 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0, | 40 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0, |
45 if (ngx_mutex_lock(ngx_event_timer_mutex) == NGX_ERROR) { | 45 if (ngx_mutex_lock(ngx_event_timer_mutex) == NGX_ERROR) { |
46 return; | 46 return; |
47 } | 47 } |
48 #endif | 48 #endif |
49 | 49 |
50 ngx_rbtree_delete(&ngx_event_timer_rbtree, &ngx_event_timer_sentinel, | 50 ngx_rbtree_delete((ngx_rbtree_t **) &ngx_event_timer_rbtree, |
51 &ngx_event_timer_sentinel, | |
51 (ngx_rbtree_t *) &ev->rbtree_key); | 52 (ngx_rbtree_t *) &ev->rbtree_key); |
52 | 53 |
53 #if (NGX_THREADS) | 54 #if (NGX_THREADS) |
54 ngx_mutex_unlock(ngx_event_timer_mutex); | 55 ngx_mutex_unlock(ngx_event_timer_mutex); |
55 #endif | 56 #endif |
85 if (ngx_mutex_lock(ngx_event_timer_mutex) == NGX_ERROR) { | 86 if (ngx_mutex_lock(ngx_event_timer_mutex) == NGX_ERROR) { |
86 return; | 87 return; |
87 } | 88 } |
88 #endif | 89 #endif |
89 | 90 |
90 ngx_rbtree_insert(&ngx_event_timer_rbtree, &ngx_event_timer_sentinel, | 91 ngx_rbtree_insert((ngx_rbtree_t **) &ngx_event_timer_rbtree, |
92 &ngx_event_timer_sentinel, | |
91 (ngx_rbtree_t *) &ev->rbtree_key); | 93 (ngx_rbtree_t *) &ev->rbtree_key); |
92 | 94 |
93 #if (NGX_THREADS) | 95 #if (NGX_THREADS) |
94 ngx_mutex_unlock(ngx_event_timer_mutex); | 96 ngx_mutex_unlock(ngx_event_timer_mutex); |
95 #endif | 97 #endif |