\brief Prevent any release attempts in the destructor. When it's known they would certainly fail. \see LeaseGuard::BreakBeforeDeletion()
| 1698 | /// When it's known they would certainly fail. |
| 1699 | /// \see LeaseGuard::BreakBeforeDeletion() |
| 1700 | ARROW_NOINLINE void Forget() { |
| 1701 | if (!PendingRelease()) { |
| 1702 | release_attempt_pending_ = false; |
| 1703 | return; |
| 1704 | } |
| 1705 | release_attempt_pending_ = false; |
| 1706 | // Remember the latest known expiry time so we can gracefully handle lease |
| 1707 | // acquisition failures by waiting until the latest forgotten lease. |
| 1708 | auto latest = latest_known_expiry_time_.load(std::memory_order_relaxed); |
| 1709 | while ( |
| 1710 | latest < break_or_expires_at_ && |
| 1711 | !latest_known_expiry_time_.compare_exchange_weak(latest, break_or_expires_at_)) { |
| 1712 | } |
| 1713 | DCHECK_GE(latest_known_expiry_time_.load(), break_or_expires_at_); |
| 1714 | } |
| 1715 | |
| 1716 | ARROW_NOINLINE static void WaitUntilLatestKnownExpiryTime() { |
| 1717 | auto remaining_time = latest_known_expiry_time_.load() - SteadyClock::now(); |
no test coverage detected