| 1178 | } |
| 1179 | |
| 1180 | bool TmpFileRemote::IncrementReadPageCount(int buffer_idx) { |
| 1181 | int64_t read_count = 0; |
| 1182 | int64_t total_num = 0; |
| 1183 | DCheckReadBufferIdx(buffer_idx); |
| 1184 | total_num = GetReadBuffPageCount(buffer_idx); |
| 1185 | { |
| 1186 | lock_guard<SpinLock> lock(lock_); |
| 1187 | read_count = ++disk_read_page_cnts_[buffer_idx]; |
| 1188 | } |
| 1189 | // Return true if all the pages have been read of the block. |
| 1190 | return read_count == total_num; |
| 1191 | } |
| 1192 | |
| 1193 | template <typename T> |
| 1194 | void TmpFileRemote::TryDeleteReadBuffer(const T& lock, int buffer_idx) { |