src/qk_loop.c
/* return 0 means successful, other means queue is full */
return 0 means successful, other means queue is full
return 0 means successful other means queue is full
int qk_add_queue(qk_cycle_t *loop, qk_queue_t *q) {
  q->loop = loop;
  uv_thread_t this_thread = uv_thread_self();
  if (uv_thread_equal(&loop->self, &this_thread)) {
    return add_queue(loop, q);
  } else {
    int err = spsc_queue_write(&loop->pending, q);
    if (!err) {
      qk_wakeup(loop);
    }
    return err;
  }
}
int qk_add_queue ( qk_cycle_t * loop , qk_queue_t * q ) { q -> loop = loop ; uv_thread_t this_thread = uv_thread_self ( ) ; if ( uv_thread_equal ( & loop -> self , & this_thread ) ) { return add_queue ( loop , q ) ; } else { int err = spsc_queue_write ( & loop -> pending , q ) ; if ( ! err ) { qk_wakeup ( loop ) ; } return err ; } }
return 0 means successful, other means queue is full
return 0 means successful other means queue is full