From 342a43e7b2ceec1dd200bffa24b052fec33f5bdc Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Fri, 30 Jul 2010 15:29:38 +0200 Subject: Introduce threading In order to enable deferred events from grail, but the event processing in a separate thread, and have the calling thread return as quickly as possible. Signed-off-by: Henrik Rydberg --- test/grail.c | 4 +++- test/touch.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/grail.c b/test/grail.c index 85c5bd4..361fd22 100644 --- a/test/grail.c +++ b/test/grail.c @@ -57,8 +57,10 @@ static void tp_gesture(struct grail *ge, const struct grail_event *ev) static void loop_device(struct grail *ge, int fd) { - while (!grail_idle(ge, fd, 5000)) + while (!grail_idle(ge, fd, 5000)) { grail_pull(ge, fd); + fprintf(stderr, "launched\n"); + } } int main(int argc, char *argv[]) diff --git a/test/touch.c b/test/touch.c index bc10b54..1dd9cd4 100644 --- a/test/touch.c +++ b/test/touch.c @@ -53,8 +53,10 @@ static void loop_device(struct touch_dev *dev, int fd) struct touch_engine engine; touch_engine_init(&engine, tp_event, tp_sync, 0); touch_engine_attach(&engine, dev); - while (!touch_dev_idle(dev, fd, 5000)) - touch_dev_pull(dev, fd); + while (!touch_dev_idle(dev, fd, 5000)) { + touch_dev_fetch(dev, fd); + touch_dev_process(dev); + } touch_engine_detach(&engine, dev); } -- cgit v1.2.3