Remove Timer::FireNow.

PiperOrigin-RevId: 811123106
This commit is contained in:
Francis Tsui
2025-09-24 18:44:41 -07:00
committed by Copybara-Service
parent eb3ae063f5
commit 72088b7fe2
15 changed files with 0 additions and 142 deletions
@@ -106,32 +106,5 @@ bool Timer::Stop() {
return true;
}
bool Timer::FireNow() {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) {
absl::AnyInvocable<void()> callback_to_run;
{
absl::MutexLock lock(&mutex_);
// Don't fire if there's no callback or if a callback is already in progress.
if (!callback_ || callback_running_) {
return;
}
callback_running_ = true;
callback_to_run = std::move(callback_);
}
// Execute callback outside of the lock.
callback_to_run();
{
absl::MutexLock lock(&mutex_);
callback_ = std::move(callback_to_run);
callback_running_ = false;
condvar_.Signal(); // Notify Stop() if it's waiting.
}
});
return true;
}
} // namespace apple
} // namespace nearby