| 372 | SharedExclusiveChecker::SharedExclusiveChecker() : impl_(new Impl) {} |
| 373 | |
| 374 | void SharedExclusiveChecker::LockShared() { |
| 375 | std::lock_guard<std::mutex> lock(impl_->mutex); |
| 376 | ARROW_CHECK_EQ(impl_->n_exclusive, 0) |
| 377 | << "Cannot perform position-independent I/O (ReadAt/GetSize) while an " |
| 378 | "exclusive operation (Read/Seek/Tell/Peek/Close/Abort) is in progress"; |
| 379 | ++impl_->n_shared; |
| 380 | } |
| 381 | |
| 382 | void SharedExclusiveChecker::UnlockShared() { |
| 383 | std::lock_guard<std::mutex> lock(impl_->mutex); |