c_cpp uv__next_timeout.c

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp uv__next_timeout.c相关的知识,希望对你有一定的参考价值。

int uv__next_timeout(const uv_loop_t* loop) {
  const struct heap_node* heap_node;
  const uv_timer_t* handle;
  uint64_t diff;

  heap_node = heap_min((const struct heap*) &loop->timer_heap);
  if (heap_node == NULL)
    return -1; /* block indefinitely */

  handle = container_of(heap_node, uv_timer_t, heap_node);
  if (handle->timeout <= loop->time)
    return 0;

  diff = handle->timeout - loop->time;
  if (diff > INT_MAX)
    diff = INT_MAX;

  return diff;
}

以上是关于c_cpp uv__next_timeout.c的主要内容,如果未能解决你的问题,请参考以下文章

c_cpp uv__handle_ref.c

c_cpp uv__handle_stop.c

c_cpp uv__handle_start.c

c_cpp uv__handle_start.c

c_cpp uv__run_timers.c

c_cpp uv__run_pending.c