[PATCH weston 1/2] clients: consolidate timer code part 1

Daniel Stone daniel at fooishbar.org
Fri Mar 9 17:39:02 UTC 2018


Hi,

On 9 March 2018 at 17:32, Derek Foreman <derekf at osg.samsung.com> wrote:
> On 2018-03-09 05:44 AM, Pekka Paalanen wrote:
>> There are multiple copies for the timerfd handling code, and I need a
>> timer in one more app. Consolidate all the timerfd code into window.c to
>> reduce the duplication. Many of the copies were also flawed against the
>> race mentioned in toytimer_fire().
>>
>> This patch handles clickdot and window.c's tooltip timer and cursor
>> timer.
>
> Just out of curiosity, how'd you decide to break it down this way?
>
> Both patches look good to me.  I hate that reset/fire race and wasted a bit
> of time understanding it the first time I hit it.  I'm really happy to see
> it handled consistently in one place.
>
> Reviewed-by: Derek Foreman <derekf at osg.samsung.com>
> For both.
>
> I think they look safe to land now, as it's mostly harmless refactor, and
> the rest is actual bug fix, as abort()ing on the read fail was wrong.
>
> I'll let you make the call on landing it. :)

I don't know timerfd well enough to comment on whether all the usage
is correct. But I like the idea of centralising error-prone things in
one place. It makes it much harder for people to get it wrong, and
does serve our thriving community of people who copy Weston code into
their own projects.

Given that, I'd be in favour of landing for release, and the series is:
Acked-by: Daniel Stone <daniels at collabora.com>

Cheers,
Daniel


More information about the wayland-devel mailing list