Commit 89887f9c authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5380 don't assert_locked during call to writers(), we may call this when...

refs #5380 don't assert_locked during call to writers(), we may call this when we assume we own the write lock, and therefore don't need the mutex

git-svn-id: file:///svn/toku/tokudb@47043 c7de825b-a66e-492c-adef-691d508d4ae1
parent ab0ea685
......@@ -2613,10 +2613,10 @@ int toku_cachetable_unpin_and_remove (
CACHETABLE ct = cachefile->cachetable;
p->dirty = CACHETABLE_CLEAN; // clear the dirty bit. We're just supposed to remove it.
assert(p->value_rwlock.writers());
// grab disk_nb_mutex to ensure any background thread writing
// out a cloned value completes
pair_lock(p);
assert(p->value_rwlock.writers());
nb_mutex_lock(&p->disk_nb_mutex, &p->mutex);
pair_unlock(p);
assert(p->cloned_value_data == NULL);
......
......@@ -225,7 +225,9 @@ inline uint32_t frwlock::blocked_users(void) const {
return m_num_want_read + m_num_want_write;
}
inline uint32_t frwlock::writers(void) const {
toku_mutex_assert_locked(m_mutex);
// this is sometimes called as "assert(lock->writers())" when we
// assume we have the write lock. if that's the assumption, we may
// not own the mutex, so we don't assert_locked here
return m_num_writers;
}
inline uint32_t frwlock::blocked_writers(void) const {
......
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