/libuv/test/ |
H A D | test-active.c | 45 uv_timer_t timer; in TEST_IMPL() local 47 r = uv_timer_init(uv_default_loop(), &timer); in TEST_IMPL() 51 ASSERT_OK(uv_is_active((uv_handle_t*) &timer)); in TEST_IMPL() 52 ASSERT_OK(uv_is_closing((uv_handle_t*) &timer)); in TEST_IMPL() 54 r = uv_timer_start(&timer, timer_cb, 1000, 0); in TEST_IMPL() 58 ASSERT_OK(uv_is_closing((uv_handle_t*) &timer)); in TEST_IMPL() 60 r = uv_timer_stop(&timer); in TEST_IMPL() 63 ASSERT_OK(uv_is_active((uv_handle_t*) &timer)); in TEST_IMPL() 66 r = uv_timer_start(&timer, timer_cb, 1000, 0); in TEST_IMPL() 72 uv_close((uv_handle_t*) &timer, close_cb); in TEST_IMPL() [all …]
|
H A D | test-tcp-connect-timeout.c | 32 static uv_timer_t timer; variable 48 ASSERT_PTR_EQ(handle, &timer); in timer_cb() 50 uv_close((uv_handle_t*)&timer, close_cb); in timer_cb() 55 ASSERT(handle == (uv_handle_t*)&conn || handle == (uv_handle_t*)&timer); in close_cb() 69 r = uv_timer_init(uv_default_loop(), &timer); in TEST_IMPL() 72 r = uv_timer_start(&timer, timer_cb, 50, 0); in TEST_IMPL() 135 r = uv_timer_init(uv_default_loop(), &timer); in TEST_IMPL() 139 r = uv_timer_start(&timer, timer_cb, 1000, 0); in TEST_IMPL() 173 r = uv_timer_init(uv_default_loop(), &timer); in TEST_IMPL() 177 r = uv_timer_start(&timer, timer_cb, 1000, 0); in TEST_IMPL()
|
H A D | test-fs-event.c | 39 static uv_timer_t timer; variable 393 touch_file((char*) timer->data); in timer_cb_touch() 457 r = uv_timer_init(loop, &timer); in TEST_IMPL() 498 r = uv_timer_init(loop, &timer); in TEST_IMPL() 731 uv_timer_t timer; in TEST_IMPL() local 735 timer.data = watchers; in TEST_IMPL() 753 uv_timer_t timer; in TEST_IMPL() local 782 timer.data = "watch_file"; in TEST_IMPL() 924 uv_timer_t timer; in TEST_IMPL() local 1179 uv_timer_t timer; in TEST_IMPL() local [all …]
|
H A D | test-tcp-reuseport.c | 83 static void ticktack(uv_timer_t* timer) { in ticktack() argument 84 ASSERT(timer == &thread_timer_handle1 || timer == &thread_timer_handle2); in ticktack() 94 uv_close((uv_handle_t*) timer, NULL); in ticktack() 95 if (timer->loop == &thread_loop1) in ticktack() 97 if (timer->loop == &thread_loop2) in ticktack() 152 uv_timer_t* timer; in run_event_loop() local 158 timer = &thread_timer_handle1; in run_event_loop() 161 timer = &thread_timer_handle2; in run_event_loop() 165 r = uv_timer_init(loop, timer); in run_event_loop() 167 r = uv_timer_start(timer, ticktack, 0, 10); in run_event_loop()
|
H A D | test-walk-handles.c | 30 static uv_timer_t timer; variable 36 if (handle == (uv_handle_t*)&timer) { in walk_cb() 45 ASSERT_PTR_EQ(handle, &timer); in timer_cb() 58 r = uv_timer_init(loop, &timer); in TEST_IMPL() 61 r = uv_timer_start(&timer, timer_cb, 1, 0); in TEST_IMPL()
|
H A D | test-loop-time.c | 37 static void cb(uv_timer_t* timer) { in cb() argument 38 uv_close((uv_handle_t*)timer, NULL); in cb() 43 uv_timer_t timer; in TEST_IMPL() local 53 r = uv_timer_init(loop, &timer); in TEST_IMPL() 59 r = uv_timer_start(&timer, cb, 1000, 0); /* 1 sec */ in TEST_IMPL()
|
H A D | test-udp-reuseport.c | 104 static void ticktack(uv_timer_t* timer) { in ticktack() argument 107 ASSERT(timer == &thread_timer_handle1 || timer == &thread_timer_handle2); in ticktack() 116 uv_close((uv_handle_t*) timer, NULL); in ticktack() 117 if (timer->loop == &thread_loop1) in ticktack() 119 if (timer->loop == &thread_loop2) in ticktack() 188 uv_timer_t* timer; in run_event_loop() local 194 timer = &thread_timer_handle1; in run_event_loop() 197 timer = &thread_timer_handle2; in run_event_loop() 201 r = uv_timer_init(loop, timer); in run_event_loop() 203 r = uv_timer_start(timer, ticktack, 0, 10); in run_event_loop()
|
H A D | test-metrics.c | 55 uv_timer_t timer; in TEST_IMPL() local 60 timer.data = &cntr; in TEST_IMPL() 63 ASSERT_OK(uv_timer_init(uv_default_loop(), &timer)); in TEST_IMPL() 64 ASSERT_OK(uv_timer_start(&timer, timer_spin_cb, timeout, 0)); in TEST_IMPL() 83 uv_timer_t timer; in metrics_routine_cb() local 88 timer.data = &cntr; in metrics_routine_cb() 92 ASSERT_OK(uv_timer_init(&loop, &timer)); in metrics_routine_cb() 134 uv_timer_t timer; in TEST_IMPL() local 138 timer.data = &cntr; in TEST_IMPL() 140 ASSERT_OK(uv_timer_init(uv_default_loop(), &timer)); in TEST_IMPL() [all …]
|
H A D | test-tcp-close-after-read-timeout.c | 28 static uv_timer_t timer; variable 53 r = uv_timer_start(&timer, on_client_timeout, 1000, 0); in on_client_connect() 75 ASSERT_PTR_EQ(handle, &timer); in on_client_timeout() 79 uv_close((uv_handle_t*) &timer, on_close); in on_client_timeout() 117 handle == (uv_handle_t*) &timer, 0); in on_close() 169 r = uv_timer_init(loop, &timer); in TEST_IMPL()
|
H A D | test-shutdown-eof.c | 27 static uv_timer_t timer; variable 127 ASSERT_PTR_EQ(handle, (uv_handle_t*) &timer); in timer_close_cb() 133 ASSERT_PTR_EQ(handle, &timer); in timer_cb() 160 r = uv_timer_init(uv_default_loop(), &timer); in TEST_IMPL() 163 uv_timer_start(&timer, timer_cb, 100, 0); in TEST_IMPL()
|
H A D | test-tcp-shutdown-after-write.c | 29 static uv_timer_t timer; variable 45 else if (handle == (uv_handle_t*)&timer) in close_cb() 112 r = uv_timer_init(loop, &timer); in TEST_IMPL() 115 r = uv_timer_start(&timer, timer_cb, 125, 0); in TEST_IMPL()
|
H A D | test-callback-stack.c | 34 static uv_timer_t timer; variable 108 ASSERT_PTR_EQ(handle, &timer); in timer_cb() 138 r = uv_timer_init(uv_default_loop(), &timer); in write_cb() 140 r = uv_timer_start(&timer, timer_cb, 500, 0); in write_cb()
|
H A D | test-fork.c | 40 static void timer_cb(uv_timer_t* timer) { in timer_cb() argument 42 uv_close((uv_handle_t*) timer, NULL); in timer_cb() 459 static void timer_cb_touch(uv_timer_t* timer) { in timer_cb_touch() argument 460 uv_close((uv_handle_t*)timer, NULL); in timer_cb_touch() 485 uv_timer_t timer; in assert_watch_file_current_dir() local 503 r = uv_timer_init(loop, &timer); in assert_watch_file_current_dir() 506 r = uv_timer_start(&timer, timer_cb_touch, 100, 0); in assert_watch_file_current_dir() 622 uv_timer_t timer; in TEST_IMPL() local 642 r = uv_timer_init(loop, &timer); in TEST_IMPL() 659 r = uv_timer_start(&timer, timer_cb_touch, 100, 0); in TEST_IMPL()
|
H A D | test-connection-fail.c | 34 static uv_timer_t timer; variable 82 uv_timer_start(&timer, timer_cb, 100, 0); in on_connect_without_close() 151 r = uv_timer_init(uv_default_loop(), &timer); in TEST_IMPL()
|
H A D | test-udp-send-unreachable.c | 34 static uv_timer_t timer; variable 97 ASSERT_PTR_EQ(h, &timer); in timer_cb() 122 r = uv_timer_init( uv_default_loop(), &timer ); in TEST_IMPL() 125 r = uv_timer_start( &timer, timer_cb, 1000, 0 ); in TEST_IMPL()
|
H A D | test-tcp-write-queue-order.c | 31 static uv_timer_t timer; variable 92 ASSERT_OK(uv_timer_init(uv_default_loop(), &timer)); in connection_cb() 93 ASSERT_OK(uv_timer_start(&timer, timer_cb, 1000, 0)); in connection_cb()
|
H A D | test-default-loop-close.c | 29 static void timer_cb(uv_timer_t* timer) { in timer_cb() argument 31 uv_close((uv_handle_t*) timer, NULL); in timer_cb()
|
H A D | test-queue-foreach-delete.c | 134 static uv_timer_t timer; variable 184 r = uv_timer_init(loop, &timer); in TEST_IMPL() 187 r = uv_timer_start(&timer, helper_timer_cb, 0, 0); in TEST_IMPL()
|
H A D | test-timer.c | 115 TEST_IMPL(timer) { in TEST_IMPL() argument 254 uv_timer_t timer; in TEST_IMPL() local 258 ASSERT_OK(uv_timer_init(loop, &timer)); in TEST_IMPL() 259 ASSERT_OK(uv_timer_start(&timer, zero_timeout_cb, 0, 0)); in TEST_IMPL() 262 uv_close((uv_handle_t*) &timer, NULL); in TEST_IMPL()
|
H A D | test-poll.c | 76 static void delay_timer_cb(uv_timer_t* timer); 443 static void delay_timer_cb(uv_timer_t* timer) { argument 444 connection_context_t* context = (connection_context_t*) timer->data; 448 ASSERT_OK(uv_is_active((uv_handle_t*) timer));
|
/libuv/docs/src/ |
H A D | timer.rst | 39 Start the timer. `timeout` and `repeat` are in milliseconds. 48 If the timer is already active, it is simply updated. 52 Stop the timer, the callback will not be called anymore. 56 Stop the timer, and if it is repeating restart it using the repeat value 57 as the timeout. If the timer has never been started before it returns 62 Set the repeat interval value in milliseconds. The timer will be scheduled 64 duration, and will follow normal timer semantics in the case of a 67 For example, if a 50ms repeating timer first runs for 17ms, it will be 69 33ms following the first timer callback, then the callback will run as soon 79 Get the timer repeat value. [all …]
|
H A D | api.rst | 14 timer
|
/libuv/src/ |
H A D | fs-poll.c | 53 static void timer_cb(uv_timer_t* timer); 172 static void timer_cb(uv_timer_t* timer) { in timer_cb() argument 175 ctx = container_of(timer, struct poll_ctx, timer_handle); in timer_cb() 234 static void timer_close_cb(uv_handle_t* timer) { in timer_close_cb() argument 240 ctx = container_of(timer, struct poll_ctx, timer_handle); in timer_close_cb()
|
/libuv/docs/src/guide/ |
H A D | utilities.rst | 12 Timers invoke the callback after a certain time has elapsed since the timer was 33 to stop the timer. This can be used safely from within the callback as well. 37 uv_timer_set_repeat(uv_timer_t *timer, int64_t repeat); 40 a timer callback, it means: 42 * If the timer was non-repeating, the timer has already been stopped. Use 44 * If the timer is repeating, the next timeout has already been scheduled, so 54 old ``repeat`` value. If the timer hasn't been started it fails (error code 57 An actual timer example is in the :ref:`reference count section 88 .. rubric:: ref-timer/main.c 89 .. literalinclude:: ../../code/ref-timer/main.c [all …]
|
/libuv/docs/code/ |
H A D | CMakeLists.txt | 21 ref-timer
|