comparison src/event/ngx_event_posted.c @ 10:46833bd150cb NGINX_0_1_5

nginx 0.1.5 *) Bugfix: on Solaris and Linux there may be too many "recvmsg() returned not enough data" alerts. *) Bugfix: there were the "writev() failed (22: Invalid argument)" errors on Solaris in proxy mode without sendfile. On other platforms that do not support sendfile at all the process got caught in an endless loop. *) Bugfix: segmentation fault on Solaris in proxy mode and using sendfile. *) Bugfix: segmentation fault on Solaris. *) Bugfix: on-line upgrade did not work on Linux. *) Bugfix: the ngx_http_autoindex_module module did not escape the spaces, the quotes, and the percent signs in the directory listing. *) Change: the decrease of the copy operations. *) Feature: the userid_p3p directive.
author Igor Sysoev <http://sysoev.ru>
date Thu, 11 Nov 2004 00:00:00 +0300
parents f0b350454894
children 6f8b0dc0f8dd
comparison
equal deleted inserted replaced
9:77eee314ddbd 10:46833bd150cb
23 for ( ;; ) { 23 for ( ;; ) {
24 24
25 ev = (ngx_event_t *) ngx_posted_events; 25 ev = (ngx_event_t *) ngx_posted_events;
26 26
27 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, 27 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
28 "posted event " PTR_FMT, ev); 28 "posted event %p", ev);
29 29
30 if (ev == NULL) { 30 if (ev == NULL) {
31 return; 31 return;
32 } 32 }
33 33
36 ev->event_handler(ev); 36 ev->event_handler(ev);
37 } 37 }
38 } 38 }
39 39
40 40
41 #if (NGX_THREADS) 41 #if (NGX_THREADS) && !(NGX_WIN32)
42 42
43 void ngx_wakeup_worker_thread(ngx_cycle_t *cycle) 43 void ngx_wakeup_worker_thread(ngx_cycle_t *cycle)
44 { 44 {
45 ngx_int_t i; 45 ngx_int_t i;
46 ngx_uint_t busy; 46 ngx_uint_t busy;
85 ev = (ngx_event_t *) ngx_posted_events; 85 ev = (ngx_event_t *) ngx_posted_events;
86 86
87 for ( ;; ) { 87 for ( ;; ) {
88 88
89 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, 89 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
90 "posted event " PTR_FMT, ev); 90 "posted event %p", ev);
91 91
92 if (ev == NULL) { 92 if (ev == NULL) {
93 return NGX_OK; 93 return NGX_OK;
94 } 94 }
95 95
96 if (ngx_trylock(ev->lock) == 0) { 96 if (ngx_trylock(ev->lock) == 0) {
97 97
98 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, 98 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
99 "posted event " PTR_FMT " is busy", ev); 99 "posted event %p is busy", ev);
100 100
101 ev = ev->next; 101 ev = ev->next;
102 continue; 102 continue;
103 } 103 }
104 104
105 if (ev->lock != ev->own_lock) { 105 if (ev->lock != ev->own_lock) {
106 if (*(ev->own_lock)) { 106 if (*(ev->own_lock)) {
107 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, 107 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
108 "the own lock of the posted event " 108 "the own lock of the posted event %p is busy", ev);
109 PTR_FMT " is busy", ev);
110 ngx_unlock(ev->lock); 109 ngx_unlock(ev->lock);
111 ev = ev->next; 110 ev = ev->next;
112 continue; 111 continue;
113 } 112 }
114 *(ev->own_lock) = 1; 113 *(ev->own_lock) = 1;
151 ngx_unlock(ev->own_lock); 150 ngx_unlock(ev->own_lock);
152 } 151 }
153 } 152 }
154 153
155 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, 154 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
156 "posted event " PTR_FMT " is done", ev); 155 "posted event %p is done", ev);
157 156
158 break; 157 break;
159 } 158 }
160 } 159 }
161 } 160 }