From 7eb84245607020b20fcf83404a7e4e93fc0a3f89 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sun, 6 Dec 2009 01:10:59 +0000 Subject: [PATCH] Add base:loopexit() method --- src/luaevent.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/luaevent.c b/src/luaevent.c index c9b5430..71188a6 100644 --- a/src/luaevent.c +++ b/src/luaevent.c @@ -89,9 +89,18 @@ static int luaevent_loop(lua_State* L) { return 1; } +static int luaevent_loopexit(lua_State*L) { + le_base *base = event_base_get(L, 1); + struct timeval tv = { 0, 10 }; + int ret = event_base_loopexit(base->base, &tv); + lua_pushinteger(L, ret); + return 1; +} + static luaL_Reg base_funcs[] = { { "addevent", luaevent_addevent }, { "loop", luaevent_loop }, + { "loopexit", luaevent_loopexit }, { NULL, NULL } }; -- 2.11.4.GIT