Helper function to check the status of a read buffer block. Caller should hold the physical_file_lock_. If the caller holds the lock of the read buffer block, IsStatusLocked() will be called.
| 454 | // If the caller holds the lock of the read buffer block, IsStatusLocked() will be |
| 455 | // called. |
| 456 | bool IsReadBufferBlockStatus(MemBlock* read_buffer_block, MemBlockStatus status, |
| 457 | const boost::shared_lock<boost::shared_mutex>& file_lock, |
| 458 | const std::unique_lock<SpinLock>* block_lock = nullptr) { |
| 459 | DCheckMemBlock(file_lock, read_buffer_block); |
| 460 | if (block_lock == nullptr) return read_buffer_block->IsStatus(status); |
| 461 | return read_buffer_block->IsStatusLocked(*block_lock, status); |
| 462 | } |
| 463 | |
| 464 | // Helper function to delete the read buffer block. |
| 465 | // Caller should hold the physical_file_lock_, but should not hold the lock of the |
no test coverage detected