mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
If precise_time is false, we should not set EVENT_BASE_FLAG_PRECISE_TIMER
Fixes: 630f077c296de61c7b99ed83bf30de11e75e2740 ("Simple unit tests for monotonic timers")
This commit is contained in:
parent
bc65ffc14c
commit
6cce7458d0
4
event.c
4
event.c
@ -591,7 +591,9 @@ event_base_new_with_config(const struct event_config *cfg)
|
||||
int flags;
|
||||
if (should_check_environment && !precise_time) {
|
||||
precise_time = evutil_getenv_("EVENT_PRECISE_TIMER") != NULL;
|
||||
base->flags |= EVENT_BASE_FLAG_PRECISE_TIMER;
|
||||
if (precise_time) {
|
||||
base->flags |= EVENT_BASE_FLAG_PRECISE_TIMER;
|
||||
}
|
||||
}
|
||||
flags = precise_time ? EV_MONOT_PRECISE : 0;
|
||||
evutil_configure_monotonic_time_(&base->monotonic_timer, flags);
|
||||
|
Loading…
x
Reference in New Issue
Block a user