Helper function to set the status of a memory block. Caller should hold the physical_file_lock_. If the caller holds the lock of the read buffer block, SetStatusLocked() will be called.
| 439 | // If the caller holds the lock of the read buffer block, SetStatusLocked() will be |
| 440 | // called. |
| 441 | void SetReadBufferBlockStatus(MemBlock* read_buffer_block, MemBlockStatus status, |
| 442 | const boost::shared_lock<boost::shared_mutex>& file_lock, |
| 443 | const std::unique_lock<SpinLock>* block_lock = nullptr) { |
| 444 | DCheckMemBlock(file_lock, read_buffer_block); |
| 445 | if (block_lock == nullptr) { |
| 446 | read_buffer_block->SetStatus(status); |
| 447 | } else { |
| 448 | read_buffer_block->SetStatusLocked(*block_lock, status); |
| 449 | } |
| 450 | } |
| 451 | |
| 452 | // Helper function to check the status of a read buffer block. |
| 453 | // Caller should hold the physical_file_lock_. |
no test coverage detected