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
This commit is contained in:
Leif Walsh 2013-04-17 00:01:04 -04:00 committed by Yoni Fogel
parent c75dae7ccd
commit f8baef6ceb
2 changed files with 4 additions and 2 deletions

View file

@ -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);

View file

@ -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 {