logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

qb_loop_timer_add - Add a timer to the mainloop.

Description

Name

       qb_loop_timer_add - Add a timer to the mainloop.

Note

       it is a one-shot job.

Params

lpointertotheloopinstanceptheprioritynsec_durationnano-secsinthefuturetorunthedispatch.datauserdatapassedintothedispatchfunctiondispatch_fncallbackfunctiontimer_handle_outhandletodeletethetimerifneeded.

Return Value

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

See Also

qb_loop_job_del(3), qb_loop_run(3), qb_loop_create(3), qb_loop_stop(3),
       qb_loop_poll_low_fds_event_set(3), qb_loop_signal_del(3), qb_loop_signal_add(3), qb_loop_job_add(3),
       qb_loop_poll_del(3), qb_loop_destroy(3), qb_loop_timer_expire_time_remaining(3), qb_loop_poll_mod(3),
       qb_loop_signal_mod(3), qb_loop_timer_del(3), qb_loop_timer_is_running(3),
       qb_loop_timer_expire_time_get(3), qb_loop_poll_add(3)

Structures

enumqb_loop_priority{QB_LOOP_LOW;QB_LOOP_MED;QB_LOOP_HIGH;};

Synopsis

#include<qb/qbloop.h>int32_tqb_loop_timer_add(
           qb_loop_t*l,                 /* pointer to the loop instance */
           enumqb_loop_priorityp,                 /* the priority */
           uint64_tnsec_duration,     /* nano-secs in the future to run the dispatch. */
           void*data,              /* user data passed into the dispatch function */
           qb_loop_timer_dispatch_fndispatch_fn,       /* callback function */
           qb_loop_timer_handle*timer_handle_out   /* handle to delete the timer if needed. */
       );

See Also