qb_loop_timer_add(3)

qb_loop_timer_add3

Add a timer to the mainloop.

Usage

#include <qb/qbloop.h>

int32_t qb_loop_timer_add(
    qb_loop_t                 *l,                 /* pointer to the loop instance */
    enum qb_loop_priority      p,                 /* the priority */
    uint64_t                   nsec_duration,     /* nano-secs in the future to run the dispatch. */
    void                      *data,              /* user data passed into the dispatch function */
    qb_loop_timer_dispatch_fn  dispatch_fn,       /* callback function */
    qb_loop_timer_handle      *timer_handle_out   /* handle to delete the timer if needed. */
);

Params

l pointer to the loop instance

p the priority

nsec_duration nano-secs in the future to run the dispatch.

data user data passed into the dispatch function

dispatch_fn callback function

timer_handle_out handle to delete the timer if needed.

Overview

Structures

enum qb_loop_priority {
      QB_LOOP_LOW;
      QB_LOOP_MED;
      QB_LOOP_HIGH;
};

Return value

status (0 == ok, -errno == failure)

Note

it is a one-shot job.

Releases

4 releases since Debian 11 (Bullseye); the text changed 3 times.

  1. 11
  2. 12
  3. 13
  4. Arch

From libqb 2.0.10-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.