diff options
author | Ruslan Ermilov <ru@nginx.com> | 2017-06-16 18:15:58 +0300 |
---|---|---|
committer | Ruslan Ermilov <ru@nginx.com> | 2017-06-16 18:15:58 +0300 |
commit | 6a4a1f0e23ae07d5a425900b1a9f3623134be55a (patch) | |
tree | 35a93e60d8263461b010379fd2b5fbdfe3f35db9 /src/core/ngx_rwlock.c | |
parent | 3f26c207560037af6cc47964da72c53d587e2def (diff) |
Introduced ngx_rwlock_downgrade().
Diffstat (limited to 'src/core/ngx_rwlock.c')
-rw-r--r-- | src/core/ngx_rwlock.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/ngx_rwlock.c b/src/core/ngx_rwlock.c index 0aed29af5..ed2b0f810 100644 --- a/src/core/ngx_rwlock.c +++ b/src/core/ngx_rwlock.c @@ -109,6 +109,15 @@ ngx_rwlock_unlock(ngx_atomic_t *lock) } +void +ngx_rwlock_downgrade(ngx_atomic_t *lock) +{ + if (*lock == NGX_RWLOCK_WLOCK) { + *lock = 1; + } +} + + #else #if (NGX_HTTP_UPSTREAM_ZONE || NGX_STREAM_UPSTREAM_ZONE) |