comparison src/core/ngx_rwlock.c @ 7037:12efcdcb8a4b

Added memory barrier semantics to ngx_rwlock_unlock().
author Ruslan Ermilov <ru@nginx.com>
date Fri, 16 Jun 2017 18:15:53 +0300
parents e769cc88f996
children d1816a2696de
comparison
equal deleted inserted replaced
7036:8666da1ecf33 7037:12efcdcb8a4b
92 ngx_atomic_uint_t readers; 92 ngx_atomic_uint_t readers;
93 93
94 readers = *lock; 94 readers = *lock;
95 95
96 if (readers == NGX_RWLOCK_WLOCK) { 96 if (readers == NGX_RWLOCK_WLOCK) {
97 *lock = 0; 97 (void) ngx_atomic_cmp_set(lock, NGX_RWLOCK_WLOCK, 0);
98 return; 98 return;
99 } 99 }
100 100
101 for ( ;; ) { 101 for ( ;; ) {
102 102