| 209 | } |
| 210 | |
| 211 | size_t StorageCache::count() const |
| 212 | { |
| 213 | std::unique_lock<fastlock> ul(m_lock, std::defer_lock); |
| 214 | bool fLocked = ul.try_lock(); |
| 215 | size_t count = m_spstorage->count(); |
| 216 | if (m_pdict != nullptr && fLocked) { |
| 217 | serverAssert(bulkInsertsInProgress.load(std::memory_order_seq_cst) || count == (dictSize(m_pdict) + m_collisionCount)); |
| 218 | } |
| 219 | return count; |
| 220 | } |
| 221 | |
| 222 | void StorageCache::beginWriteBatch() { |
| 223 | serverAssert(GlobalLocksAcquired()); // Otherwise we deadlock |
no test coverage detected