MCPcopy Create free account
hub / github.com/Kitware/CMake / uv_timer_start

Function uv_timer_start

Utilities/cmlibuv/src/timer.c:67–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65
66
67int uv_timer_start(uv_timer_t* handle,
68 uv_timer_cb cb,
69 uint64_t timeout,
70 uint64_t repeat) {
71 uint64_t clamped_timeout;
72
73 if (uv__is_closing(handle) || cb == NULL)
74 return UV_EINVAL;
75
76 if (uv__is_active(handle))
77 uv_timer_stop(handle);
78
79 clamped_timeout = handle->loop->time + timeout;
80 if (clamped_timeout < timeout)
81 clamped_timeout = (uint64_t) -1;
82
83 handle->timer_cb = cb;
84 handle->timeout = clamped_timeout;
85 handle->repeat = repeat;
86 /* start_id is the second index to be compared in timer_less_than() */
87 handle->start_id = handle->loop->timer_counter++;
88
89 heap_insert(timer_heap(handle->loop),
90 (struct heap_node*) &handle->heap_node,
91 timer_less_than);
92 uv__handle_start(handle);
93
94 return 0;
95}
96
97
98int uv_timer_stop(uv_timer_t* handle) {

Callers 6

StartJobMethod · 0.85
testUVStreambufReadFunction · 0.85
poll_cbFunction · 0.85
uv_timer_againFunction · 0.85
eof_timer_startFunction · 0.85
startMethod · 0.85

Calls 2

uv_timer_stopFunction · 0.85
timer_heapFunction · 0.85

Tested by 2

StartJobMethod · 0.68
testUVStreambufReadFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…