Lines Matching full:it
57 itimer_t *it = &state->tfd_itimer; in timerfd_itimer_lock() local
61 while (it->it_lock & ITLK_LOCKED) { in timerfd_itimer_lock()
62 it->it_blockers++; in timerfd_itimer_lock()
63 cv_wait(&it->it_cv, &state->tfd_lock); in timerfd_itimer_lock()
64 it->it_blockers--; in timerfd_itimer_lock()
67 it->it_lock |= ITLK_LOCKED; in timerfd_itimer_lock()
71 return (it); in timerfd_itimer_lock()
75 timerfd_itimer_unlock(timerfd_state_t *state, itimer_t *it) in timerfd_itimer_unlock() argument
77 VERIFY(it == &state->tfd_itimer); in timerfd_itimer_unlock()
78 VERIFY(it->it_lock & ITLK_LOCKED); in timerfd_itimer_unlock()
82 it->it_lock &= ~ITLK_LOCKED; in timerfd_itimer_unlock()
84 if (it->it_blockers) in timerfd_itimer_unlock()
85 cv_signal(&it->it_cv); in timerfd_itimer_unlock()
91 timerfd_fire(itimer_t *it) in timerfd_fire() argument
93 timerfd_state_t *state = it->it_frontend; in timerfd_fire()
168 * Our tfd_fired is non-zero; slurp its value and then clear it. in timerfd_read()
256 itimer_t *it; in timerfd_ioctl() local
265 it = timerfd_itimer_lock(state); in timerfd_ioctl()
267 if (it->it_backend != NULL) { in timerfd_ioctl()
268 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
272 if ((it->it_backend = clock_get_backend(arg)) == NULL) { in timerfd_ioctl()
273 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
279 * of locking CLOCK_REALTIME-based timers -- it is safe to in timerfd_ioctl()
282 it->it_proc = &p0; in timerfd_ioctl()
284 err = it->it_backend->clk_timer_create(it, timerfd_fire); in timerfd_ioctl()
287 it->it_backend = NULL; in timerfd_ioctl()
288 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
292 it->it_frontend = state; in timerfd_ioctl()
293 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
299 it = timerfd_itimer_lock(state); in timerfd_ioctl()
301 if (it->it_backend == NULL) { in timerfd_ioctl()
302 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
306 err = it->it_backend->clk_timer_gettime(it, &when); in timerfd_ioctl()
307 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
327 it = timerfd_itimer_lock(state); in timerfd_ioctl()
329 if (it->it_backend == NULL) { in timerfd_ioctl()
330 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
335 err = it->it_backend->clk_timer_gettime(it, &oval); in timerfd_ioctl()
338 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
353 * timer value, but before it can fire with the new one). in timerfd_ioctl()
360 * this is possible, it does not (for the moment) seem worth in timerfd_ioctl()
361 * it: if the timer is firing at essentially the same moment in timerfd_ioctl()
362 * that it's being reprogrammed, there is a higher-level race in timerfd_ioctl()
364 * have to properly resolve -- and it seems reasonable to in timerfd_ioctl()
365 * simply allow the program to resolve it in this case. in timerfd_ioctl()
371 err = it->it_backend->clk_timer_settime(it, in timerfd_ioctl()
374 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
397 itimer_t *it; in timerfd_close() local
408 * No one can get to this timer; we don't need to lock it -- we can in timerfd_close()
409 * just call on the backend to delete it. in timerfd_close()
411 it = &state->tfd_itimer; in timerfd_close()
413 if (it->it_backend != NULL) in timerfd_close()
414 it->it_backend->clk_timer_delete(it); in timerfd_close()