diff options
author | Andrea Shepard <andrea@persephoneslair.org> | 2014-11-19 12:18:05 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-12-04 09:30:20 -0500 |
commit | f2645f80c135b44a9e82f809662da4bef93e8726 (patch) | |
tree | 5b0dcae520c0112dba699826e13c689462f01c52 /event.c | |
parent | 6ae44b5da98dfe0b28972d06f9c0c1c406344c80 (diff) | |
download | libevent-f2645f80c135b44a9e82f809662da4bef93e8726.tar.gz |
Implement new/free for struct evutil_monotonic_timer and export monotonic time functions
Diffstat (limited to 'event.c')
-rw-r--r-- | event.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -993,6 +993,21 @@ done: return (res); } +/* Get the monotonic time for this event_base' timer */ +int +event_gettime_monotonic(struct event_base *base, struct timeval *tv) +{ + int rv = -1; + + if (base && tv) { + EVBASE_ACQUIRE_LOCK(base, th_base_lock); + rv = evutil_gettime_monotonic_(&(base->monotonic_timer), tv); + EVBASE_RELEASE_LOCK(base, th_base_lock); + } + + return rv; +} + const char ** event_get_supported_methods(void) { |