Event loop abstraction API

Submitted by Quentin Glidic on Feb. 19, 2018, 7:19 p.m.

Details

Reviewer None
Submitted Feb. 19, 2018, 7:19 p.m.
Last Updated Feb. 19, 2018, 7:19 p.m.
Revision 1

Cover Letter(s)

Revision 1
      From: Quentin Glidic <sardemff7+git@sardemff7.net>

We discussed on IRC about races between the several event sources that
exist in libweston, libwayland and compositor code. Adding a priority
system in the event loop is a first step to fix these potential races
and help cope with bad clients.
A second issue is that compositor writers are usually used to some
specific event loop library (GLib, Qt, libev or any other) with
differences in APIs and some frameworks are tied to one.

To make things easier to compositor writers, here is a draft for an
event loop API abstraction that should allow to pick any library to work
with libweston.
(Still lacking the signal handling part.)

Sending as RFC to check if the API is fine by Weston contributors before
migrating all the codebase to it.

Cheers,

Quentin Glidic (2):
  libweston: Add event loop abstraction API
  compositor-x11: Use event loop abstraction API

 compositor/main.c          | 182 +++++++++++++++++++++++++++++++++++++++++++--
 libweston/compositor-x11.c |  64 ++++++++--------
 libweston/compositor.c     |  86 +++++++++++++++++++++
 libweston/compositor.h     |  67 +++++++++++++++++
 4 files changed, 358 insertions(+), 41 deletions(-)
    

Revisions