src/lua_objs.c
branchlua-threads
changeset 207 3fa22abb5421
parent 203 ffdf53fd0337
child 211 b460d958a685
equal deleted inserted replaced
206:47837a6bbbea 207:3fa22abb5421
   367     // build tv
   367     // build tv
   368     struct timeval tv = { tv_sec, 0 };
   368     struct timeval tv = { tv_sec, 0 };
   369     
   369     
   370     // schedule wakeup
   370     // schedule wakeup
   371     // use a pure-timeout event
   371     // use a pure-timeout event
   372     if (event_base_once(lua_nexus->nexus->ev_base, -1, 0, lua_nexus_sleep_wakeup, L, &tv))
   372     if (event_base_once(lua_nexus->nexus->ev_base, -1, EV_TIMEOUT, lua_nexus_sleep_wakeup, L, &tv))
   373         return luaL_error(L, "event_base_once");
   373         return luaL_error(L, "event_base_once");
   374 
   374 
   375     // yield
   375     // yield
   376     return lua_yield(L, 0);
   376     return lua_yield(L, 0);
   377 }
   377 }