Fix TODO: Add uev_*_start() functions.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2015-02-15 18:13:36 +01:00
1 parent bfcea55b1e
commit 2f8c45f438
6 files changed
+73 -8

No files matched your search

+19
View File
@@ -130,6 +130,25 @@ int uev_timer_set(uev_t *w, int timeout, int period)
return 0;
}
/**
* Start a stopped timer watcher
* @param w Watcher to start (again)
*
* @return POSIX OK(0) or non-zero with @param errno set on error.
*/
int uev_timer_start(uev_t *w)
{
if (!w) {
errno = EINVAL;
return -1;
}
if (-1 != w->fd)
uev_watcher_stop(w);
return uev_timer_set(w, w->timeout, w->period);
}
/**
* Stop and unregister a timer watcher
* @param w Watcher to stop