Lines Matching defs:timer
56 // Callback and timer threads should run at RT priority in order to ensure they
57 // meet audio deadlines. Use this priority for all audio/timer related thread.
129 static timer_t timer;
155 static bool timer_create_internal(const clockid_t clock_id, timer_t* timer);
303 timer_delete(timer);
315 // the |timer| variable is valid ourselves.
327 if (!timer_create_internal(CLOCK_ID, &timer)) goto error;
382 if (timer_initialized) timer_delete(timer);
434 // Add it into the timer list sorted by deadline (earliest deadline first).
466 // If used in a zeroed state, disarms the timer.
487 // timer would be canceled, the current behavior (as of Linux kernel 3.17)
489 // *_ALARM timer is to delete the timer. But unfortunately, deleting and
490 // re-creating a timer is rather expensive; every timer_create(2) spawns a
491 // new thread. So we simply set the timer to fire at the largest possible
495 // wait for the next timer to fire. In that case, there's no reason to
496 // have a pending wakeup timer so we simply cancel it.
511 LOG_ERROR(LOG_TAG, "%s unable to set wakeup timer: %s", __func__,
522 if (timer_settime(timer, TIMER_ABSTIME, &timer_time, NULL) == -1)
523 LOG_ERROR(LOG_TAG, "%s unable to set timer: %s", __func__, strerror(errno));
525 // If next expiration was in the past (e.g. short timer that got context
526 // switched) then the timer might have diarmed itself. Detect this case and
529 // It is possible that the timer was actually super short (a few
530 // milliseconds) and the timer expired normally before we called
533 // dispatch function checks to make sure the timer at the head of the list
537 timer_gettime(timer, &time_to_expire);
606 // Callback function for wake alarms and our posix timer
659 static bool timer_create_internal(const clockid_t clock_id, timer_t* timer) {
660 CHECK(timer != NULL);
663 // create timer with RT priority thread
675 if (timer_create(clock_id, &sigevent, timer) == -1) {
676 LOG_ERROR(LOG_TAG, "%s unable to create timer with clock %d: %s", __func__,