mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 14:46:12 -04:00
Fix potential deadlock by running timer callback in another thread
PiperOrigin-RevId: 538469916
This commit is contained in:
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;
|
||||
|
||||
Reference in New Issue
Block a user