aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-01-11 16:07:03 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-01-11 16:07:03 +0000
commit896b5e4a4f0e6194e3fd5c7b9896932da16f0801 (patch)
tree23c5f9f9d2e03945359d05eaff2e6157fdc305cc
parent2ffaa986e2d0ced70017c842f8873a335b9719df (diff)
downloadnginx-896b5e4a4f0e6194e3fd5c7b9896932da16f0801.tar.gz
nginx-896b5e4a4f0e6194e3fd5c7b9896932da16f0801.zip
optimize inlined code for gcc
-rw-r--r--src/core/ngx_shmtx.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/core/ngx_shmtx.h b/src/core/ngx_shmtx.h
index 1361125de..7d4c09e3d 100644
--- a/src/core/ngx_shmtx.h
+++ b/src/core/ngx_shmtx.h
@@ -30,11 +30,7 @@ ngx_int_t ngx_shmtx_create(ngx_shmtx_t *mtx, void *addr, u_char *name);
static ngx_inline ngx_uint_t
ngx_shmtx_trylock(ngx_shmtx_t *mtx)
{
- if (*mtx->lock == 0 && ngx_atomic_cmp_set(mtx->lock, 0, ngx_pid)) {
- return 1;
- }
-
- return 0;
+ return (*mtx->lock == 0 && ngx_atomic_cmp_set(mtx->lock, 0, ngx_pid));
}
#define ngx_shmtx_lock(mtx) ngx_spinlock((mtx)->lock, ngx_pid, 1024)