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

iv_timer_register, iv_timer_unregister, iv_timer_registered - deal with ivykis timers

Description

       The  functions  iv_timer_register and iv_timer_unregister register, respectively unregister, a timer with
       the current thread's ivykis event loop.  iv_timer_registered on a timer returns true  if  that  timer  is
       currently registered with ivykis.

       When  a  timer that is registered becomes 'ready', due to the current system clock value becoming greater
       than or equal to the timer's ->expires member field, the callback  function  specified  by  ->handler  is
       called  in  the  thread  that  the timer was registered in, with ->cookie as its first and sole argument.
       When this happens, the timer is transparently unregistered.

       The application is allowed to change the ->cookie and ->handler members at any time.  The application  is
       not allowed to change the ->expires member while the timer is registered.

       A  given  structiv_timer  can  only  be  registered  in  one  thread at a time, and a timer can only be
       unregistered in the thread that it was registered from.

       There is no limit on the number of timers registered at once.

       See iv_examples(3) for programming examples.

Name

       iv_timer_register, iv_timer_unregister, iv_timer_registered - deal with ivykis timers

See Also

ivykis(3), iv_examples(3)

ivykis                                             2010-08-15                                        iv_timer(3)

Synopsis

#include<iv.h>

       struct iv_timer {
               struct timespec         expires;
               void                    *cookie;
               void                    (*handler)(void *);
       };

       voidIV_TIMER_INIT(structiv_timer*timer);voidiv_timer_register(structiv_timer*timer);voidiv_timer_unregister(structiv_timer*timer);intiv_timer_registered(conststructiv_timer*timer);

See Also