Lines Matching +full:1000 +full:base +full:- +full:t

2  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
26 #include "util-internal.h"
31 #include "event2/event-config.h"
61 #include "evthread-internal.h"
62 #include "event-internal.h"
63 #include "defer-internal.h"
66 #include "time-internal.h"
78 EVLOCK_LOCK(cw->lock, 0); in wake_all_timeout()
79 EVTHREAD_COND_BROADCAST(cw->cond); in wake_all_timeout()
80 EVLOCK_UNLOCK(cw->lock, 0); in wake_all_timeout()
88 EVLOCK_LOCK(cw->lock, 0); in wake_one_timeout()
89 EVTHREAD_COND_SIGNAL(cw->cond); in wake_one_timeout()
90 EVLOCK_UNLOCK(cw->lock, 0); in wake_one_timeout()
102 struct event_base *base = arg; in basic_thread() local
111 evtimer_assign(&ev, base, wake_all_timeout, &cw); in basic_thread()
134 event_base_loopexit(base, NULL); in basic_thread()
150 struct event_base *base = arg; in sigchld_cb() local
155 event_base_loopexit(base, &tv); in sigchld_cb()
174 struct event_base *base = data->base; in thread_basic() local
182 tt_assert(base); in thread_basic()
183 if (evthread_make_base_notifiable(base)<0) { in thread_basic()
184 tt_abort_msg("Couldn't make base notifiable!"); in thread_basic()
188 if (data->setup_data && !strcmp(data->setup_data, "forking")) { in thread_basic()
191 sigchld_event = evsignal_new(base, SIGCHLD, sigchld_cb, base); in thread_basic()
193 * inside libevent internals. Not a good idea in non-testing in thread_basic()
195 notification_event = event_new(base, in thread_basic()
196 base->th_notify_fd[0], EV_READ|EV_PERSIST, notify_fd_cb, in thread_basic()
203 if (event_reinit(base) < 0) { in thread_basic()
207 event_assign(notification_event, base, in thread_basic()
208 base->th_notify_fd[0], EV_READ|EV_PERSIST, in thread_basic()
214 event_base_dispatch(base); in thread_basic()
216 if (waitpid(pid, &status, 0) == -1) in thread_basic()
229 THREAD_START(threads[i], basic_thread, base); in thread_basic()
231 evtimer_assign(&ev, base, NULL, NULL); in thread_basic()
233 tv.tv_sec = 1000; in thread_basic()
236 event_base_dispatch(base); in thread_basic()
273 EVLOCK_LOCK(rec->cond->lock, 0); in wait_for_condition()
274 if (rec->delay.tv_sec || rec->delay.tv_usec) { in wait_for_condition()
275 r = EVTHREAD_COND_WAIT_TIMED(rec->cond->cond, rec->cond->lock, in wait_for_condition()
276 &rec->delay); in wait_for_condition()
278 r = EVTHREAD_COND_WAIT(rec->cond->cond, rec->cond->lock); in wait_for_condition()
280 EVLOCK_UNLOCK(rec->cond->lock, 0); in wait_for_condition()
282 evutil_gettimeofday(&rec->alerted_at, NULL); in wait_for_condition()
284 rec->timed_out = 1; in wait_for_condition()
301 struct event_base *base = data->base; in thread_conditions_simple() local
305 tv_signal.tv_usec = 30*1000; in thread_conditions_simple()
306 tv_timeout.tv_usec = 150*1000; in thread_conditions_simple()
307 tv_broadcast.tv_usec = 500*1000; in thread_conditions_simple()
322 evtimer_assign(&wake_one, base, wake_one_timeout, &cond); in thread_conditions_simple()
323 evtimer_assign(&wake_all, base, wake_all_timeout, &cond); in thread_conditions_simple()
337 event_base_dispatch(base); in thread_conditions_simple()
396 tv.tv_sec = ms/1000; in SLEEP_MS()
397 tv.tv_usec = (ms%1000)*1000; in SLEEP_MS()
426 event_deferred_cb_init_(&data->cbs[i], 0, deferred_callback, in load_deferred_queue()
428 event_deferred_cb_schedule_(data->queue, &data->cbs[i]); in load_deferred_queue()
456 struct event_base *base = NULL; in thread_deferred_cb_skew() local
466 base = event_base_new_with_config(cfg); in thread_deferred_cb_skew()
467 tt_assert(base); in thread_deferred_cb_skew()
470 deferred_data[i].queue = base; in thread_deferred_cb_skew()
473 event_base_once(base, -1, EV_TIMEOUT, timer_callback, NULL, in thread_deferred_cb_skew()
475 event_base_once(base, -1, EV_TIMEOUT, start_threads_callback, in thread_deferred_cb_skew()
477 event_base_dispatch(base); in thread_deferred_cb_skew()
492 if (base) in thread_deferred_cb_skew()
493 event_base_free(base); in thread_deferred_cb_skew()
518 tv.tv_usec = 100*1000; in register_events_subthread()
520 tv.tv_usec = 150*1000; in register_events_subthread()
535 exit_base = data->base; in thread_no_events()
539 event_assign(&time_events[i], data->base, in thread_no_events()
540 -1, 0, note_time_cb, &times[i]); in thread_no_events()
544 THREAD_START(thread, register_events_subthread, data->base); in thread_no_events()
545 event_base_loop(data->base, EVLOOP_NO_EXIT_ON_EMPTY); in thread_no_events()
547 tt_assert(event_base_got_break(data->base)); in thread_no_events()