Lines Matching refs:looper

17 #include "android/looper.h"
40 GLooper* looper;
46 static void glooper_addActiveTimer(GLooper* looper, GLoopTimer* timer);
47 static void glooper_delActiveTimer(GLooper* looper, GLoopTimer* timer);
48 static void glooper_addTimer(GLooper* looper, GLoopTimer* timer);
49 static void glooper_delTimer(GLooper* looper, GLoopTimer* timer);
56 glooper_delActiveTimer(tt->looper, tt);
75 glooper_addActiveTimer(tt->looper, tt);
86 glooptimer_startAbsolute(tt, timeout_ms + glooper_now((Looper*)tt->looper));
105 glooper_delTimer(tt->looper, tt);
118 glooper_timer_init(Looper* looper,
130 tt->looper = (GLooper*) looper;
132 glooper_addTimer(tt->looper, tt);
152 GLooper* looper;
155 static void glooper_delPendingIo(GLooper* looper, GLoopIo* io);
156 static void glooper_addIo(GLooper* looper, GLoopIo* io);
157 static void glooper_delIo(GLooper* looper, GLoopIo* io);
158 static void glooper_modifyFd(GLooper* looper, int fd, int oldwanted, int newwanted);
171 glooper_delPendingIo(io->looper, io);
174 glooper_modifyFd(io->looper, io->fd, io->wanted, wanted);
218 glooper_delPendingIo(io->looper, io);
220 glooper_delIo(io->looper, io);
234 glooper_io_init(Looper* looper, LoopIo* user, int fd, LoopIoFunc callback, void* opaque)
236 GLooper* gg = (GLooper*)looper;
243 io->looper = (GLooper*) looper;
264 Looper looper;
277 glooper_addTimer(GLooper* looper, GLoopTimer* tt)
279 arefSet_add(looper->timers, tt);
283 glooper_delTimer(GLooper* looper, GLoopTimer* tt)
285 arefSet_del(looper->timers, tt);
289 glooper_addActiveTimer(GLooper* looper, GLoopTimer* tt)
292 GLoopTimer** pnode = &looper->activeTimers;
304 glooper_delActiveTimer(GLooper* looper, GLoopTimer* tt)
306 GLoopTimer** pnode = &looper->activeTimers;
320 glooper_addIo(GLooper* looper, GLoopIo* io)
322 arefSet_add(looper->ios, io);
326 glooper_delIo(GLooper* looper, GLoopIo* io)
328 arefSet_del(looper->ios, io);
332 glooper_delPendingIo(GLooper* looper, GLoopIo* io)
334 arefSet_del(looper->pendingIos, io);
338 glooper_modifyFd(GLooper* looper, int fd, int oldWanted, int newWanted)
341 looper->numActiveIos += 1;
344 looper->numActiveIos -= 1;
346 iolooper_modify(looper->iolooper, fd, oldWanted, newWanted);
358 GLooper* looper = (GLooper*)ll;
359 looper->running = 0;
365 GLooper* looper = (GLooper*) ll;
366 IoLooper* iol = looper->iolooper;
368 looper->running = 1;
370 while (looper->running)
377 if (looper->numActiveIos == 0 && looper->activeTimers == NULL)
383 if (looper->activeTimers != NULL)
384 deadline = looper->activeTimers->deadline;
398 AREFSET_FOREACH(looper->ios, io, {
412 arefSet_add(looper->pendingIos, io);
423 GLoopTimer* timer = looper->activeTimers;
429 looper->activeTimers = timer->activeNext;
452 AREFSET_FOREACH(looper->pendingIos,io,{
455 arefSet_clear(looper->pendingIos);
467 GLooper* looper = (GLooper*)ll;
469 arefSet_done(looper->timers);
470 looper->activeTimers = NULL;
472 arefSet_done(looper->ios);
473 arefSet_done(looper->pendingIos);
475 iolooper_free(looper->iolooper);
476 looper->iolooper = NULL;
478 AFREE(looper);
483 GLooper* looper;
485 ANEW0(looper);
487 looper->iolooper = iolooper_new();
489 looper->looper.now = glooper_now;
490 looper->looper.timer_init = glooper_timer_init;
491 looper->looper.io_init = glooper_io_init;
492 looper->looper.run = glooper_run;
493 looper->looper.forceQuit = glooper_forceQuit;
494 looper->looper.destroy = glooper_free;
500 return &looper->looper;