RESOLVED FIXED 213771
[Cocoa] [GTK] RunLoop::Timer::isActive() is incorrect for timers while they are firing
https://bugs.webkit.org/show_bug.cgi?id=213771
Summary [Cocoa] [GTK] RunLoop::Timer::isActive() is incorrect for timers while they a...
Geoffrey Garen
Reported 2020-06-29 20:32:20 PDT
RunLoop::Timer::isActive() is true for one-shot timers even when they're not active
Attachments
Patch (2.96 KB, patch)
2020-06-29 20:44 PDT, Geoffrey Garen
no flags
Patch (4.04 KB, patch)
2020-06-30 12:30 PDT, Geoffrey Garen
no flags
Assertion fix (1.37 KB, patch)
2020-06-30 22:00 PDT, Geoffrey Garen
no flags
Geoffrey Garen
Comment 1 2020-06-29 20:44:41 PDT
Geoffrey Garen
Comment 2 2020-06-30 07:44:49 PDT
Looks like a variant of gtk had this bug too.
Geoffrey Garen
Comment 3 2020-06-30 12:30:24 PDT
Darin Adler
Comment 4 2020-06-30 17:19:33 PDT
Comment on attachment 403223 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=403223&action=review > Source/WTF/wtf/cf/RunLoopCF.cpp:95 > + if (!CFRunLoopTimerDoesRepeat(cfTimer)) > + timer->stop(); > + > timer->fired(); Could we have put this code inside TimerBase::fired instead? Or does it not have an efficient way to check if the timer is non-repeating? If stop() would do the trick on GLib too that would be neat.
Geoffrey Garen
Comment 5 2020-06-30 17:50:17 PDT
Glib already had the implicit stop behavior. It needed the inverse fix: be sure to restart if you are a repeating timer. I do think we can/should do a shared implementation of isActive in TimerBase. Windows already has all the code we need; just need to migrate it. I hope to return and do that after I finish off callOnMainThread.
EWS
Comment 6 2020-06-30 19:17:30 PDT
Committed r263783: <https://trac.webkit.org/changeset/263783> All reviewed patches have been landed. Closing bug and clearing flags on attachment 403223 [details].
Radar WebKit Bug Importer
Comment 7 2020-06-30 19:18:14 PDT
Geoffrey Garen
Comment 8 2020-06-30 22:00:02 PDT
Reopening to attach new patch.
Geoffrey Garen
Comment 9 2020-06-30 22:00:03 PDT
Created attachment 403265 [details] Assertion fix
EWS
Comment 10 2020-06-30 22:21:13 PDT
Committed r263786: <https://trac.webkit.org/changeset/263786> All reviewed patches have been landed. Closing bug and clearing flags on attachment 403265 [details].
Note You need to log in before you can comment on or make changes to this bug.