| 386 | } |
| 387 | |
| 388 | void SharedExclusiveChecker::LockExclusive() { |
| 389 | std::lock_guard<std::mutex> lock(impl_->mutex); |
| 390 | ARROW_CHECK_EQ(impl_->n_shared, 0) |
| 391 | << "Cannot perform exclusive I/O operation (Read/Seek/Tell/Peek/Close/Abort) while " |
| 392 | "position-independent operations (ReadAt/GetSize) are in progress"; |
| 393 | ARROW_CHECK_EQ(impl_->n_exclusive, 0) |
| 394 | << "Cannot perform exclusive I/O operation (Read/Seek/Tell/Peek/Close/Abort) while " |
| 395 | "another exclusive operation is already in progress"; |
| 396 | ++impl_->n_exclusive; |
| 397 | } |
| 398 | |
| 399 | void SharedExclusiveChecker::UnlockExclusive() { |
| 400 | std::lock_guard<std::mutex> lock(impl_->mutex); |