diff options
author | Sergey Kandaurov <pluknet@nginx.com> | 2022-01-25 23:42:48 +0300 |
---|---|---|
committer | Sergey Kandaurov <pluknet@nginx.com> | 2022-01-25 23:42:48 +0300 |
commit | 025fa0374ee9604e39e0ee97fc1cdd425043ea5f (patch) | |
tree | 291367a91145f157826cc2cb00e413ef47884b39 /src/core | |
parent | 264dd955cb81dff66908556b5ed8ebbd5cac8ef8 (diff) | |
parent | 60ca13f98846bb1140359972d42276db88f4a409 (diff) | |
download | nginx-025fa0374ee9604e39e0ee97fc1cdd425043ea5f.tar.gz nginx-025fa0374ee9604e39e0ee97fc1cdd425043ea5f.zip |
Merged with the default branch.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/nginx.h | 4 | ||||
-rw-r--r-- | src/core/ngx_rwlock.c | 18 |
2 files changed, 5 insertions, 17 deletions
diff --git a/src/core/nginx.h b/src/core/nginx.h index 5ad6aff45..daac21e2c 100644 --- a/src/core/nginx.h +++ b/src/core/nginx.h @@ -9,8 +9,8 @@ #define _NGINX_H_INCLUDED_ -#define nginx_version 1021005 -#define NGINX_VERSION "1.21.5" +#define nginx_version 1021006 +#define NGINX_VERSION "1.21.6" #define NGINX_VER "nginx/" NGINX_VERSION #ifdef NGX_BUILD diff --git a/src/core/ngx_rwlock.c b/src/core/ngx_rwlock.c index ed2b0f810..e7da8a8ec 100644 --- a/src/core/ngx_rwlock.c +++ b/src/core/ngx_rwlock.c @@ -89,22 +89,10 @@ ngx_rwlock_rlock(ngx_atomic_t *lock) void ngx_rwlock_unlock(ngx_atomic_t *lock) { - ngx_atomic_uint_t readers; - - readers = *lock; - - if (readers == NGX_RWLOCK_WLOCK) { + if (*lock == NGX_RWLOCK_WLOCK) { (void) ngx_atomic_cmp_set(lock, NGX_RWLOCK_WLOCK, 0); - return; - } - - for ( ;; ) { - - if (ngx_atomic_cmp_set(lock, readers, readers - 1)) { - return; - } - - readers = *lock; + } else { + (void) ngx_atomic_fetch_add(lock, -1); } } |