Permalink
Browse files

net, refactor: remove unused event from libev.

  • Loading branch information...
xicilion committed Oct 25, 2017
1 parent f0459a3 commit 666ae9f38d1ace9ad8d32dbde1966b9151f540c4
Showing with 4 additions and 21 deletions.
  1. +4 −21 fibjs/src/io/AsyncIO_ev.cpp
@@ -192,19 +192,17 @@ class _acIO : public exlib::OSThread {
virtual void Run()
{
Runtime rt(NULL);
ev_async_init(&s_asEvent, as_cb);
ev_async_start(s_loop, &s_asEvent);
ev_timer tm;
tm_cb(s_loop, &tm, 0);
Runtime rt(NULL);
ev_run(s_loop, 0);
}
private:
static void doAsync()
static void as_cb(struct ev_loop* loop, struct ev_async* watcher,
int32_t revents)
{
exlib::List<asyncEv> jobs;
asyncEv* p1;
@@ -214,21 +212,6 @@ class _acIO : public exlib::OSThread {
while ((p1 = jobs.getHead()) != 0)
p1->start();
}
static void tm_cb(struct ev_loop* loop, struct ev_timer* watcher,
int32_t revents)
{
ev_timer_init(watcher, tm_cb, 10, 0);
ev_timer_start(s_loop, watcher);
doAsync();
}
static void as_cb(struct ev_loop* loop, struct ev_async* watcher,
int32_t revents)
{
doAsync();
}
};
void init_aio()

0 comments on commit 666ae9f

Please sign in to comment.