Fix potential deadlock by running timer callback in another thread

PiperOrigin-RevId: 538469916
This commit is contained in:
Nick Bourdakos
2023-06-07 06:37:21 -07:00
committed by Copybara-Service
parent 8e280832bf
commit 8fc0d93ce1
@@ -82,7 +82,9 @@ bool Timer::Stop() {
bool Timer::FireNow() {
if (callback_ != nil) {
callback_();
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) {
callback_();
});
return true;
}
return false;