Lines Matching refs:tv
428 struct timeval tv; in gettime() local
429 evutil_gettimeofday(&tv,NULL); in gettime()
430 evutil_timersub(&tv, tp, &base->tv_clock_diff); in gettime()
438 event_base_gettimeofday_cached(struct event_base *base, struct timeval *tv) in event_base_gettimeofday_cached() argument
444 return evutil_gettimeofday(tv, NULL); in event_base_gettimeofday_cached()
449 r = evutil_gettimeofday(tv, NULL); in event_base_gettimeofday_cached()
451 evutil_timeradd(&base->tv_cache, &base->tv_clock_diff, tv); in event_base_gettimeofday_cached()
1090 event_gettime_monotonic(struct event_base *base, struct timeval *tv) in event_gettime_monotonic() argument
1094 if (base && tv) { in event_gettime_monotonic()
1096 rv = evutil_gettime_monotonic_(&(base->monotonic_timer), tv); in event_gettime_monotonic()
1403 #define COMMON_TIMEOUT_IDX(tv) \ argument
1404 (((tv)->tv_usec & COMMON_TIMEOUT_IDX_MASK)>>COMMON_TIMEOUT_IDX_SHIFT)
1408 is_common_timeout(const struct timeval *tv, in is_common_timeout() argument
1412 if ((tv->tv_usec & COMMON_TIMEOUT_MASK) != COMMON_TIMEOUT_MAGIC) in is_common_timeout()
1414 idx = COMMON_TIMEOUT_IDX(tv); in is_common_timeout()
1430 get_common_timeout_list(struct event_base *base, const struct timeval *tv) in get_common_timeout_list() argument
1432 return base->common_timeout_queues[COMMON_TIMEOUT_IDX(tv)]; in get_common_timeout_list()
1437 common_timeout_ok(const struct timeval *tv,
1441 &get_common_timeout_list(base, tv)->duration;
1442 return tv->tv_sec == expect->tv_sec &&
1443 tv->tv_usec == expect->tv_usec;
1491 struct timeval tv; in event_base_init_common_timeout() local
1497 memcpy(&tv, duration, sizeof(struct timeval)); in event_base_init_common_timeout()
1499 tv.tv_usec &= MICROSECONDS_MASK; in event_base_init_common_timeout()
1500 tv.tv_sec += tv.tv_usec / 1000000; in event_base_init_common_timeout()
1501 tv.tv_usec %= 1000000; in event_base_init_common_timeout()
1502 duration = &tv; in event_base_init_common_timeout()
1766 struct timeval tv; in event_process_active() local
1771 gettime(base, &tv); in event_process_active()
1772 evutil_timeradd(&base->max_dispatch_time, &tv, &tv); in event_process_active()
1773 endtime = &tv; in event_process_active()
1837 event_loopexit(const struct timeval *tv) in event_loopexit() argument
1840 current_base, tv)); in event_loopexit()
1844 event_base_loopexit(struct event_base *event_base, const struct timeval *tv) in event_base_loopexit() argument
1847 event_base, tv)); in event_base_loopexit()
1926 struct timeval tv; in event_base_loop() local
1969 tv_p = &tv; in event_base_loop()
1977 evutil_timerclear(&tv); in event_base_loop()
2044 void *arg, const struct timeval *tv) in event_once() argument
2046 return event_base_once(current_base, fd, events, callback, arg, tv); in event_once()
2053 void *arg, const struct timeval *tv) in event_base_once() argument
2076 if (tv == NULL || ! evutil_timerisset(tv)) { in event_base_once()
2098 res = event_add_nolock_(&eonce->ev, tv, 0); in event_base_once()
2375 event_pending(const struct event *ev, short event, struct timeval *tv) in event_pending() argument
2397 if (tv != NULL && (flags & event & EV_TIMEOUT)) { in event_pending()
2401 evutil_timeradd(&ev->ev_base->tv_clock_diff, &tmp, tv); in event_pending()
2484 event_add(struct event *ev, const struct timeval *tv) in event_add() argument
2495 res = event_add_nolock_(ev, tv, 0); in event_add()
2597 event_add_nolock_(struct event *ev, const struct timeval *tv, in event_add_nolock_() argument
2614 tv ? "EV_TIMEOUT " : " ", in event_add_nolock_()
2628 if (tv != NULL && !(ev->ev_flags & EVLIST_TIMEOUT)) { in event_add_nolock_()
2666 if (res != -1 && tv != NULL) { in event_add_nolock_()
2681 ev->ev_io_timeout = *tv; in event_add_nolock_()
2709 common_timeout = is_common_timeout(tv, base); in event_add_nolock_()
2716 ev->ev_timeout = *tv; in event_add_nolock_()
2718 struct timeval tmp = *tv; in event_add_nolock_()
2722 (tv->tv_usec & ~MICROSECONDS_MASK); in event_add_nolock_()
2724 evutil_timeradd(&now, tv, &ev->ev_timeout); in event_add_nolock_()
2729 ev, (int)tv->tv_sec, (int)tv->tv_usec, ev->ev_callback)); in event_add_nolock_()
3148 struct timeval *tv = *tv_p; in timeout_next() local
3165 evutil_timerclear(tv); in timeout_next()
3169 evutil_timersub(&ev->ev_timeout, &now, tv); in timeout_next()
3171 EVUTIL_ASSERT(tv->tv_sec >= 0); in timeout_next()
3172 EVUTIL_ASSERT(tv->tv_usec >= 0); in timeout_next()
3173 …event_debug(("timeout_next: event: %p, in %d seconds, %d useconds", ev, (int)tv->tv_sec, (int)tv->… in timeout_next()
3761 struct timeval tv; in dump_inserted_event_fn() local
3762 tv.tv_sec = e->ev_timeout.tv_sec; in dump_inserted_event_fn()
3763 tv.tv_usec = e->ev_timeout.tv_usec & MICROSECONDS_MASK; in dump_inserted_event_fn()
3764 evutil_timeradd(&tv, &base->tv_clock_diff, &tv); in dump_inserted_event_fn()
3766 (long)tv.tv_sec, (int)(tv.tv_usec & MICROSECONDS_MASK)); in dump_inserted_event_fn()