Commit 426521a6 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

refs #5240, small simplification

git-svn-id: file:///svn/toku/tokudb@45627 c7de825b-a66e-492c-adef-691d508d4ae1
parent 65ee0dc0
...@@ -107,13 +107,11 @@ static inline void rwlock_write_unlock(RWLOCK rwlock) { ...@@ -107,13 +107,11 @@ static inline void rwlock_write_unlock(RWLOCK rwlock) {
assert(rwlock->reader == 0); assert(rwlock->reader == 0);
assert(rwlock->writer == 1); assert(rwlock->writer == 1);
rwlock->writer--; rwlock->writer--;
if (rwlock->writer == 0) {
if (rwlock->want_write) { if (rwlock->want_write) {
toku_cond_signal(&rwlock->wait_write); toku_cond_signal(&rwlock->wait_write);
} else if (rwlock->want_read) { } else if (rwlock->want_read) {
toku_cond_broadcast(&rwlock->wait_read); toku_cond_broadcast(&rwlock->wait_read);
} }
}
} }
// returns: the number of readers // returns: the number of readers
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment