| 29 | } |
| 30 | |
| 31 | int64_t BlockingCounter::Decrease() { |
| 32 | std::unique_lock<std::mutex> lck(mtx_); |
| 33 | cnt_val_ -= 1; |
| 34 | if (cnt_val_ == 0) { cond_.notify_all(); } |
| 35 | return cnt_val_; |
| 36 | } |
| 37 | |
| 38 | Maybe<void> BlockingCounter::WaitUntilCntEqualZero(size_t timeout_seconds) { |
| 39 | return Singleton<ForeignLockHelper>::Get()->WithScopedRelease([&, this]() -> Maybe<void> { |
no outgoing calls
no test coverage detected