Code review comment for lp:~vanvugt/compiz-core/fix-timer-infinite-loop

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

A test case without X events happening is a bit tricky. But I think something like creating 2 timers:
(a) interval 0
(b) interval 500
And then waiting 2000ms, verifying that (b) has been called >= 2 times, should work. With the bug, (a) will always stay in front of (b) so (b) is never called.

I'll look at doing this soon.

On a related note, is there a good reason why CompTimer and the associated classes are so complex? I tried rewriting CompTimer with g_timeout_add_full, and deleted the associated timeoutsource/handler classes, and found it performed much better (due to better pre-emption - other events can be handled between timer callbacks) and was much smaller...

« Back to merge proposal