comparison src/core/ngx_shmtx.h @ 274:052a7b1d40e5 NGINX_0_5_7

nginx 0.5.7 *) Feature: the ssl_session_cache storage optimization. *) Bugfixes in the "ssl_session_cache" and "limit_zone" directives. *) Bugfix: the segmentation fault was occurred on start or while reconfiguration if the "ssl_session_cache" or "limit_zone" directives were used on 64-bit platforms. *) Bugfix: a segmentation fault occurred if the "add_before_body" or "add_after_body" directives were used and there was no "Content-Type" header line in response. *) Bugfix: the OpenSSL library was always built with the threads support. Thanks to Den Ivanov. *) Bugfix: the PCRE-6.5+ library and the icc compiler compatibility.
author Igor Sysoev <http://sysoev.ru>
date Mon, 15 Jan 2007 00:00:00 +0300
parents 6ae1357b7b7c
children 5bef04fc3fd5
comparison
equal deleted inserted replaced
273:60df8db42ffb 274:052a7b1d40e5
28 #if (NGX_HAVE_ATOMIC_OPS) 28 #if (NGX_HAVE_ATOMIC_OPS)
29 29
30 static ngx_inline ngx_uint_t 30 static ngx_inline ngx_uint_t
31 ngx_shmtx_trylock(ngx_shmtx_t *mtx) 31 ngx_shmtx_trylock(ngx_shmtx_t *mtx)
32 { 32 {
33 if (*mtx->lock == 0 && ngx_atomic_cmp_set(mtx->lock, 0, ngx_pid)) { 33 return (*mtx->lock == 0 && ngx_atomic_cmp_set(mtx->lock, 0, ngx_pid));
34 return 1;
35 }
36
37 return 0;
38 } 34 }
39 35
40 #define ngx_shmtx_lock(mtx) ngx_spinlock((mtx)->lock, ngx_pid, 1024) 36 #define ngx_shmtx_lock(mtx) ngx_spinlock((mtx)->lock, ngx_pid, 1024)
41 37
42 #define ngx_shmtx_unlock(mtx) (void) ngx_atomic_cmp_set((mtx)->lock, ngx_pid, 0) 38 #define ngx_shmtx_unlock(mtx) (void) ngx_atomic_cmp_set((mtx)->lock, ngx_pid, 0)