event_base_update_cache_time should be a no-op if the loop isn't running

This commit is contained in:
Nick Mathewson 2013-04-24 13:23:15 -04:00
parent 1c3147f5e7
commit 5e6fa2a3ab

View File

@ -426,6 +426,7 @@ event_base_update_cache_time(struct event_base *base)
} }
EVBASE_ACQUIRE_LOCK(base, th_base_lock); EVBASE_ACQUIRE_LOCK(base, th_base_lock);
if (base->running_loop)
update_time_cache(base); update_time_cache(base);
EVBASE_RELEASE_LOCK(base, th_base_lock); EVBASE_RELEASE_LOCK(base, th_base_lock);
return 0; return 0;