Mercurial > hg > nginx
comparison src/os/unix/ngx_freebsd_rfork_thread.c @ 501:d4ea69372b94 release-0.1.25
nginx-0.1.25-RELEASE import
*) Bugfix: nginx did run on Linux parisc.
*) Feature: nginx now does not start under FreeBSD if the sysctl
kern.ipc.somaxconn value is too big.
*) Bugfix: if a request was internally redirected by the
ngx_http_index_module module to the ngx_http_proxy_module or
ngx_http_fastcgi_module modules, then the index file was not closed
after request completion.
*) Feature: the "proxy_pass" can be used in location with regular
expression.
*) Feature: the ngx_http_rewrite_filter_module module supports the
condition like "if ($HTTP_USER_AGENT ~ MSIE)".
*) Bugfix: nginx started too slow if the large number of addresses and
text values were used in the "geo" directive.
*) Change: a variable name must be declared as "$name" in the "geo"
directive. The previous variant without "$" is still supported, but
will be removed soon.
*) Feature: the "%{VARIABLE}v" logging parameter.
*) Feature: the "set $name value" directive.
*) Bugfix: gcc 4.0 compatibility.
*) Feature: the --with-openssl-opt=OPTIONS autoconfiguration directive.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sat, 19 Mar 2005 12:38:37 +0000 |
parents | 2ff194b74f1e |
children | 9c2f3ed7a247 |
comparison
equal
deleted
inserted
replaced
500:9a0f304470f5 | 501:d4ea69372b94 |
---|---|
225 return NGX_ERROR; | 225 return NGX_ERROR; |
226 } | 226 } |
227 | 227 |
228 /* create the thread errno' array */ | 228 /* create the thread errno' array */ |
229 | 229 |
230 if (!(errnos = ngx_calloc(n * sizeof(int), cycle->log))) { | 230 errnos = ngx_calloc(n * sizeof(int), cycle->log); |
231 if (errnos == NULL) { | |
231 return NGX_ERROR; | 232 return NGX_ERROR; |
232 } | 233 } |
233 | 234 |
234 /* create the thread tids array */ | 235 /* create the thread tids array */ |
235 | 236 |
236 if (!(tids = ngx_calloc((n + 1) * sizeof(ngx_tid_t), cycle->log))) { | 237 tids = ngx_calloc((n + 1) * sizeof(ngx_tid_t), cycle->log); |
238 if (tids == NULL) { | |
237 return NGX_ERROR; | 239 return NGX_ERROR; |
238 } | 240 } |
239 | 241 |
240 tids[0] = ngx_pid; | 242 tids[0] = ngx_pid; |
241 | 243 |
262 } | 264 } |
263 | 265 |
264 | 266 |
265 ngx_tid_t ngx_thread_self() | 267 ngx_tid_t ngx_thread_self() |
266 { | 268 { |
267 int tid; | 269 ngx_int_t tid; |
268 ngx_tid_t pid; | |
269 | 270 |
270 tid = ngx_gettid(); | 271 tid = ngx_gettid(); |
271 | 272 |
272 if (tids == NULL) { | 273 if (tids == NULL) { |
273 return ngx_pid; | 274 return ngx_pid; |
303 ngx_mutex_t *ngx_mutex_init(ngx_log_t *log, ngx_uint_t flags) | 304 ngx_mutex_t *ngx_mutex_init(ngx_log_t *log, ngx_uint_t flags) |
304 { | 305 { |
305 ngx_mutex_t *m; | 306 ngx_mutex_t *m; |
306 union semun op; | 307 union semun op; |
307 | 308 |
308 if (!(m = ngx_alloc(sizeof(ngx_mutex_t), log))) { | 309 m = ngx_alloc(sizeof(ngx_mutex_t), log); |
310 if (m == NULL) { | |
309 return NULL; | 311 return NULL; |
310 } | 312 } |
311 | 313 |
312 m->lock = 0; | 314 m->lock = 0; |
313 m->log = log; | 315 m->log = log; |
351 } | 353 } |
352 | 354 |
353 | 355 |
354 ngx_int_t ngx_mutex_dolock(ngx_mutex_t *m, ngx_int_t try) | 356 ngx_int_t ngx_mutex_dolock(ngx_mutex_t *m, ngx_int_t try) |
355 { | 357 { |
356 uint32_t lock, new, old; | 358 uint32_t lock, old; |
357 ngx_uint_t tries; | 359 ngx_uint_t tries; |
358 struct sembuf op; | 360 struct sembuf op; |
359 | 361 |
360 if (!ngx_threaded) { | 362 if (!ngx_threaded) { |
361 return NGX_OK; | 363 return NGX_OK; |
481 } | 483 } |
482 | 484 |
483 | 485 |
484 ngx_int_t ngx_mutex_unlock(ngx_mutex_t *m) | 486 ngx_int_t ngx_mutex_unlock(ngx_mutex_t *m) |
485 { | 487 { |
486 uint32_t lock, new, old; | 488 uint32_t lock, old; |
487 struct sembuf op; | 489 struct sembuf op; |
488 | 490 |
489 if (!ngx_threaded) { | 491 if (!ngx_threaded) { |
490 return NGX_OK; | 492 return NGX_OK; |
491 } | 493 } |
574 | 576 |
575 ngx_cond_t *ngx_cond_init(ngx_log_t *log) | 577 ngx_cond_t *ngx_cond_init(ngx_log_t *log) |
576 { | 578 { |
577 ngx_cond_t *cv; | 579 ngx_cond_t *cv; |
578 | 580 |
579 if (!(cv = ngx_alloc(sizeof(ngx_cond_t), log))) { | 581 cv = ngx_alloc(sizeof(ngx_cond_t), log); |
582 if (cv == NULL) { | |
580 return NULL; | 583 return NULL; |
581 } | 584 } |
582 | 585 |
583 cv->signo = NGX_CV_SIGNAL; | 586 cv->signo = NGX_CV_SIGNAL; |
584 cv->tid = -1; | 587 cv->tid = -1; |