Fix potential deadlock by running timer callback in another thread

PiperOrigin-RevId: 538469916
This commit is contained in:
Nick Bourdakos
2023-06-07 19:16:08 +00:00
committed by Suet-fei Li
parent ee262121c3
commit 8fc16247d3
@@ -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;