/libuv/src/unix/ |
H A D | posix-poll.c | 182 assert(timeout >= -1); in uv__io_poll() 188 timeout = 0; in uv__io_poll() 201 if (timeout != 0) in uv__io_poll() 228 if (timeout == -1) in uv__io_poll() 230 if (timeout > 0) in uv__io_poll() 247 if (timeout == -1) in uv__io_poll() 250 if (timeout == 0) in uv__io_poll() 327 if (timeout == 0) in uv__io_poll() 330 if (timeout == -1) in uv__io_poll() 334 assert(timeout > 0); in uv__io_poll() [all …]
|
H A D | kqueue.c | 253 assert(timeout >= -1); in uv__io_poll() 259 user_timeout = timeout; in uv__io_poll() 260 timeout = 0; in uv__io_poll() 269 if (timeout != 0) in uv__io_poll() 272 if (timeout != -1) { in uv__io_poll() 297 assert(timeout != -1); in uv__io_poll() 455 timeout = 0; in uv__io_poll() 462 if (timeout == 0) in uv__io_poll() 465 if (timeout == -1) in uv__io_poll() 468 assert(timeout > 0); in uv__io_poll() [all …]
|
H A D | sunos.c | 200 assert(timeout >= -1); in uv__io_poll() 207 timeout = 0; in uv__io_poll() 216 if (timeout != 0) in uv__io_poll() 219 if (timeout != -1) { in uv__io_poll() 266 if (timeout == 0) in uv__io_poll() 344 timeout = 0; in uv__io_poll() 355 if (timeout == 0) in uv__io_poll() 358 if (timeout == -1) in uv__io_poll() 368 timeout -= diff; in uv__io_poll() 453 timespec_t timeout; in uv__fs_event_read() local [all …]
|
H A D | os390.c | 878 assert(timeout >= -1); in uv__io_poll() 888 timeout = 0; in uv__io_poll() 898 if (timeout != 0) in uv__io_poll() 927 if (timeout == -1) in uv__io_poll() 930 if (timeout == 0) in uv__io_poll() 949 if (timeout == -1) in uv__io_poll() 952 if (timeout == 0) in uv__io_poll() 1038 timeout = 0; in uv__io_poll() 1044 if (timeout == 0) in uv__io_poll() 1047 if (timeout == -1) in uv__io_poll() [all …]
|
H A D | aix.c | 219 assert(timeout >= -1); in uv__io_poll() 226 timeout = 0; in uv__io_poll() 235 if (timeout != 0) in uv__io_poll() 261 if (timeout > 0) in uv__io_poll() 279 if (timeout == -1) in uv__io_poll() 282 if (timeout == 0) in uv__io_poll() 354 timeout = 0; in uv__io_poll() 360 if (timeout == 0) in uv__io_poll() 363 if (timeout == -1) in uv__io_poll() 367 assert(timeout > 0); in uv__io_poll() [all …]
|
H A D | thread.c | 820 int uv_cond_timedwait(uv_cond_t* cond, uv_mutex_t* mutex, uint64_t timeout) { in uv_cond_timedwait() argument 828 ts.tv_sec = timeout / NANOSEC; in uv_cond_timedwait() 829 ts.tv_nsec = timeout % NANOSEC; in uv_cond_timedwait() 835 timeout += tv.tv_sec * NANOSEC + tv.tv_usec * 1e3; in uv_cond_timedwait() 837 timeout += uv__hrtime(UV_CLOCK_PRECISE); in uv_cond_timedwait() 839 ts.tv_sec = timeout / NANOSEC; in uv_cond_timedwait() 840 ts.tv_nsec = timeout % NANOSEC; in uv_cond_timedwait()
|
H A D | linux.c | 1387 assert(timeout >= -1); in uv__io_poll() 1390 real_timeout = timeout; in uv__io_poll() 1394 user_timeout = timeout; in uv__io_poll() 1395 timeout = 0; in uv__io_poll() 1455 if (timeout != 0) in uv__io_poll() 1476 assert(timeout != -1); in uv__io_poll() 1594 timeout = 0; in uv__io_poll() 1601 if (timeout == 0) in uv__io_poll() 1604 if (timeout == -1) in uv__io_poll() 1607 assert(timeout > 0); in uv__io_poll() [all …]
|
H A D | os390-syscalls.h | 57 int epoll_wait(uv__os390_epoll* ep, struct epoll_event *events, int maxevents, int timeout);
|
H A D | core.c | 426 int timeout; in uv_run() local 452 timeout = 0; in uv_run() 454 timeout = uv__backend_timeout(loop); in uv_run() 458 uv__io_poll(loop, timeout); in uv_run() 1793 struct timespec timeout; in uv_sleep() local 1796 timeout.tv_sec = msec / 1000; in uv_sleep() 1797 timeout.tv_nsec = (msec % 1000) * 1000 * 1000; in uv_sleep() 1800 rc = nanosleep(&timeout, &timeout); in uv_sleep()
|
/libuv/src/ |
H A D | timer.c | 46 if (a->timeout < b->timeout) in timer_less_than() 48 if (b->timeout < a->timeout) in timer_less_than() 61 handle->timeout = 0; in uv_timer_init() 70 uint64_t timeout, in uv_timer_start() argument 80 if (clamped_timeout < timeout) in uv_timer_start() 84 handle->timeout = clamped_timeout; in uv_timer_start() 137 if (handle->loop->time >= handle->timeout) in uv_timer_get_due_in() 140 return handle->timeout - handle->loop->time; in uv_timer_get_due_in() 154 if (handle->timeout <= loop->time) in uv__next_timeout() 157 diff = handle->timeout - loop->time; in uv__next_timeout() [all …]
|
/libuv/src/win/ |
H A D | core.c | 442 user_timeout = timeout; in uv__poll_wine() 443 timeout = 0; in uv__poll_wine() 452 if (timeout != 0) in uv__poll_wine() 470 timeout = user_timeout; in uv__poll_wine() 495 } else if (timeout > 0) { in uv__poll_wine() 535 user_timeout = timeout; in uv__poll() 536 timeout = 0; in uv__poll() 542 actual_timeout = timeout; in uv__poll() 547 if (timeout != 0) in uv__poll() 620 DWORD timeout; in uv_run() local [all …]
|
H A D | poll.c | 275 struct timeval timeout; in uv__slow_poll_thread_proc() local 299 timeout.tv_sec = 3 * 60; in uv__slow_poll_thread_proc() 300 timeout.tv_usec = 0; in uv__slow_poll_thread_proc() 302 r = select(1, (fd_set*) &rfds, (fd_set*) &wfds, (fd_set*) &efds, &timeout); in uv__slow_poll_thread_proc()
|
/libuv/test/ |
H A D | benchmark-queue-work.c | 53 int timeout; in BENCHMARK_IMPL() local 56 timeout = 5000; in BENCHMARK_IMPL() 59 ASSERT_OK(uv_timer_start(&timer_handle, timer_cb, timeout, 0)); in BENCHMARK_IMPL() 66 timeout / 1000., in BENCHMARK_IMPL() 67 fmt(&fmtbuf[1], events / (timeout / 1000.))); in BENCHMARK_IMPL()
|
H A D | benchmark-million-async.c | 83 int timeout; in BENCHMARK_IMPL() local 87 timeout = 5000; in BENCHMARK_IMPL() 101 ASSERT_OK(uv_timer_start(&timer_handle, timer_cb, timeout, 0)); in BENCHMARK_IMPL() 106 timeout / 1000., in BENCHMARK_IMPL() 107 fmt(&fmtbuf[1], container->async_events / (timeout / 1000.)), in BENCHMARK_IMPL()
|
H A D | benchmark-million-timers.c | 48 int timeout; in BENCHMARK_IMPL() local 55 timeout = 0; in BENCHMARK_IMPL() 59 if (i % 1000 == 0) timeout++; in BENCHMARK_IMPL() 61 ASSERT_OK(uv_timer_start(timers + i, timer_cb, timeout, 0)); in BENCHMARK_IMPL()
|
H A D | runner.h | 49 int timeout; member 69 #define TEST_ENTRY_CUSTOM(name, is_helper, show_output, timeout) \ argument 70 { #name, #name, &run_test_##name, is_helper, show_output, timeout }, 144 int process_wait(process_info_t *vec, int n, int timeout);
|
H A D | test-metrics.c | 54 const uint64_t timeout = 1000; in TEST_IMPL() local 64 ASSERT_OK(uv_timer_start(&timer, timer_spin_cb, timeout, 0)); in TEST_IMPL() 72 ASSERT_LE(idle_time, (timeout + 500) * UV_NS_TO_MS); in TEST_IMPL() 73 ASSERT_GE(idle_time, (timeout - 500) * UV_NS_TO_MS); in TEST_IMPL() 81 const uint64_t timeout = 1000; in metrics_routine_cb() local 93 ASSERT_OK(uv_timer_start(&timer, timer_spin_cb, timeout, 0)); in metrics_routine_cb() 104 ASSERT_GE(idle_time, (timeout - 500) * UV_NS_TO_MS); in metrics_routine_cb()
|
H A D | test-udp-ipv6.c | 36 || (uv_timer_t*)(handle) == &timeout, 0) 45 static uv_timer_t timeout; variable 141 uv_close((uv_handle_t*)&timeout, close_cb); in timeout_cb() 204 r = uv_timer_init(uv_default_loop(), &timeout); in do_test() 207 r = uv_timer_start(&timeout, timeout_cb, 500, 0); in do_test()
|
H A D | runner-unix.c | 236 int process_wait(process_info_t* vec, int n, int timeout) { in process_wait() argument 255 if (timeout == -1) { in process_wait() 308 if (elapsed_ms >= (unsigned) timeout) in process_wait() 311 tv.tv_sec = (timeout - elapsed_ms) / 1000; in process_wait() 312 tv.tv_usec = (timeout - elapsed_ms) % 1000 * 1000; in process_wait()
|
H A D | benchmark-udp-pummel.c | 150 unsigned long timeout) { in pummel() argument 164 if (timeout) { in pummel() 166 ASSERT_OK(uv_timer_start(&timer_handle, timeout_cb, timeout, 0)); in pummel()
|
H A D | test-condvar.c | 231 uint64_t timeout; in TEST_IMPL() local 233 timeout = 100 * 1000 * 1000; /* 100 ms in ns */ in TEST_IMPL() 241 ASSERT_EQ(UV_ETIMEDOUT, uv_cond_timedwait(&wc.cond, &wc.mutex, timeout)); in TEST_IMPL()
|
H A D | runner-win.c | 179 int process_wait(process_info_t *vec, int n, int timeout) { in process_wait() argument 193 if (timeout >= 0) { in process_wait() 194 timeout_api = (DWORD)timeout; in process_wait()
|
/libuv/docs/src/ |
H A D | timer.rst | 37 .. c:function:: int uv_timer_start(uv_timer_t* handle, uv_timer_cb cb, uint64_t timeout, uint64_t r… 39 Start the timer. `timeout` and `repeat` are in milliseconds. 41 If `timeout` is zero, the callback fires on the next event loop iteration. 42 If `repeat` is non-zero, the callback fires first after `timeout` 57 as the timeout. If the timer has never been started before it returns 75 then the old repeat value will have been used to schedule the next timeout.
|
H A D | design.rst | 82 #. Poll timeout is calculated. Before blocking for I/O the loop calculates for how long it should 83 block. These are the rules when calculating the timeout: 85 * If the loop was run with the ``UV_RUN_NOWAIT`` flag, the timeout is 0. 86 * If the loop is going to be stopped (:c:func:`uv_stop` was called), the timeout is 0. 87 * If there are no active handles or requests, the timeout is 0. 88 * If there are any idle handles active, the timeout is 0. 89 * If there are any handles pending to be closed, the timeout is 0. 90 * If none of the above cases matches, the timeout of the closest timer is taken, or
|
/libuv/docs/code/uvwget/ |
H A D | main.c | 9 uv_timer_t timeout; variable 82 uv_timer_stop(&timeout); in curl_perform() 106 uv_timer_start(&timeout, on_timeout, timeout_ms, 0); in start_timeout() 153 uv_timer_init(loop, &timeout); in main()
|