unix: stub out timer methods
This commit is contained in:
parent
810651e04c
commit
b969809d20
46
uv-unix.c
46
uv-unix.c
@ -867,23 +867,6 @@ void uv_unref() {
|
||||
}
|
||||
|
||||
|
||||
void uv__timeout(EV_P_ ev_timer* watcher, int revents) {
|
||||
uv_req_t* req = watcher->data;
|
||||
assert(watcher == &req->timer);
|
||||
assert(EV_TIMER & revents);
|
||||
|
||||
/* This watcher is not repeating. */
|
||||
assert(!ev_is_active(watcher));
|
||||
assert(!ev_is_pending(watcher));
|
||||
|
||||
if (req->cb) {
|
||||
uv_timer_cb cb = req->cb;
|
||||
/* TODO skew */
|
||||
cb(req, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void uv_update_time() {
|
||||
ev_now_update(EV_DEFAULT_UC);
|
||||
}
|
||||
@ -894,14 +877,6 @@ int64_t uv_now() {
|
||||
}
|
||||
|
||||
|
||||
int uv_timeout(uv_req_t* req, int64_t timeout) {
|
||||
ev_timer_init(&req->timer, uv__timeout, timeout / 1000.0, 0.0);
|
||||
ev_timer_start(EV_DEFAULT_UC_ &req->timer);
|
||||
req->timer.data = req;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int uv_read_start(uv_handle_t* handle, uv_read_cb cb) {
|
||||
/* The UV_READING flag is irrelevant of the state of the handle - it just
|
||||
* expresses the desired state of the user.
|
||||
@ -1085,3 +1060,24 @@ int uv_async_init(uv_handle_t* handle, uv_async_cb async_cb,
|
||||
int uv_async_send(uv_handle_t* handle) {
|
||||
ev_async_send(EV_DEFAULT_UC_ &handle->async_watcher);
|
||||
}
|
||||
|
||||
|
||||
int uv_timer_init(uv_handle_t* handle, uv_close_cb close_cb, void* data) {
|
||||
assert(0 && "implement me");
|
||||
}
|
||||
|
||||
|
||||
int uv_timer_start(uv_handle_t* handle, uv_loop_cb cb, int64_t timeout,
|
||||
int64_t repeat) {
|
||||
assert(0 && "implement me");
|
||||
}
|
||||
|
||||
|
||||
int uv_timer_stop(uv_handle_t* handle) {
|
||||
assert(0 && "implement me");
|
||||
}
|
||||
|
||||
|
||||
int uv_timer_again(uv_handle_t* handle) {
|
||||
assert(0 && "implement me");
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user