Changeset

2098:a1ad06f1c090

util.timer: Fix libevent timers (event.base doesn't exist...)
author Matthew Wild <mwild1@gmail.com>
date Sat, 21 Nov 2009 03:16:14 +0000
parents 2097:642806f67b75
children 2099:73e083d01449
files util/timer.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/timer.lua	Sat Nov 21 03:15:59 2009 +0000
+++ b/util/timer.lua	Sat Nov 21 03:16:14 2009 +0000
@@ -9,6 +9,7 @@
 
 local ns_addtimer = require "net.server".addtimer;
 local event = require "net.server".event;
+local event_base = require "net.server".event_base;
 
 local get_time = os.time;
 local t_insert = table.insert;
@@ -54,7 +55,7 @@
 else
 	local EVENT_LEAVE = (event.core and event.core.LEAVE) or -1;
 	function _add_task(delay, func)
-		event.base:addevent(nil, event.EV_TIMEOUT, function ()
+		event_base:addevent(nil, event.EV_TIMEOUT, function ()
 			local ret = func();
 			if ret then
 				_add_task(ret, func);