Doc: a timer must have a non-zero timeout value to be armed properly

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-11-19 11:29:19 +01:00
1 parent f75b1d5080
commit dbf8c0dae2
2 files changed
+6 -2

No files matched your search

+1 -1
View File
@@ -69,7 +69,7 @@ int uev_io_set (uev_t *w, int fd, int events);
int uev_io_start (uev_t *w);
int uev_io_stop (uev_t *w);
/* Timer watcher: schedule a relative timer, timeout and period in milliseconds */
/* Timer watcher: schedule a relative timer, timeout (must be non-zero) and period in milliseconds */
int uev_timer_init (uev_ctx_t *ctx, uev_t *w, uev_cb_t *cb, void *arg, int timeout, int period);
int uev_timer_set (uev_t *w, int timeout, int period); /* Change timeout or period */
int uev_timer_start (uev_t *w); /* Restart a stopped timer */
+5 -1
View File
@@ -93,9 +93,13 @@ int uev_timer_init(uev_ctx_t *ctx, uev_t *w, uev_cb_t *cb, void *arg, int timeou
/**
* Reset a timer
* @param w Watcher to reset
* @param timeout Timeout in milliseconds before @param cb is called
* @param timeout Timeout in milliseconds before @param cb is called, zero disarms timer
* @param period For periodic timers this is the period time that @param timeout is reset to
*
* Note, the @param timeout value must be non-zero. Setting it to zero
* will disarm the timer. This is the underlying Linux function @func
* timerfd_settimer() which has this behavior.
*
* @return POSIX OK(0) or non-zero with @param errno set on error.
*/
int uev_timer_set(uev_t *w, int timeout, int period)