Home | History | Annotate | Download | only in android

Lines Matching refs:looper

43 /* A Looper is an abstraction for an event loop, which can
49 * Once you have a Looper pointer, you can register "watchers" that
63 * Looper methods from them (e.g. looper_now(), looper_forceQuit(), etc..)
65 * You can create a new Looper by calling looper_newGeneric(). This provides
68 * For the QEMU core, you can grab a Looper pointer by calling
72 typedef struct Looper Looper;
74 /* Create a new generic looper that can be used in any context / thread. */
75 Looper* looper_newGeneric(void);
77 /* Create a new looper which is implemented on top of the QEMU main event
81 Looper* looper_newCore(void);
90 struct Looper {
91 Duration (*now) (Looper* looper);
92 void (*timer_init)(Looper* looper, LoopTimer* timer, LoopTimerFunc callback, void* opaque);
93 void (*io_init) (Looper* looper, LoopIo* io, int fd, LoopIoFunc callback, void* opaque);
94 int (*run) (Looper* looper, Duration deadline_ms);
95 void (*forceQuit) (Looper* looper);
96 void (*destroy) (Looper* looper);
126 * Each timer belongs to only one looper object.
130 Looper* looper,
134 looper->timer_init(looper, timer, callback, opaque);
223 loopIo_init(LoopIo* io, Looper* looper, int fd, LoopIoFunc callback, void* opaque)
225 looper->io_init(looper, io, fd, callback, opaque);
274 looper_now(Looper* looper)
276 return looper->now(looper);
279 * more registered watchers for events/timers in the looper.
283 * EWOULDBLOCK -> there are not more watchers registered (the looper
287 looper_run(Looper* looper)
289 (void) looper->run(looper, DURATION_INFINITE);
295 * Returns the reason why the looper stopped:
297 * EWOULDBLOCK -> there are not more watchers registered (the looper
303 looper_runWithTimeout(Looper* looper, Duration timeout_ms)
306 timeout_ms += looper_now(looper);
308 return looper->run(looper, timeout_ms);
315 looper_runWithDeadline(Looper* looper, Duration deadline_ms)
317 return looper->run(looper, deadline_ms);
325 looper_forceQuit(Looper* looper)
327 looper->forceQuit(looper);
330 /* Destroy a given looper object. Only works for those created
337 looper_free(Looper* looper)
339 if (looper)
340 looper->destroy(looper);