Add base:loopexit() method

Sun, 06 Dec 2009 01:10:59 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Sun, 06 Dec 2009 01:10:59 +0000
changeset 66
0173c0fc0cf0
parent 65
e65466cee871
child 67
7fd8dbfb54d5

Add base:loopexit() method

src/luaevent.c file | annotate | diff | comparison | revisions
--- a/src/luaevent.c	Fri Nov 27 01:33:55 2009 +0000
+++ b/src/luaevent.c	Sun Dec 06 01:10:59 2009 +0000
@@ -89,9 +89,18 @@
 	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 }
 };
 

mercurial