From 2fa049d2e15dba4aedba3e7009af45668c617823 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 23 Mar 2018 21:18:15 +0100 Subject: util.timer: Move sleep() here from util.async This is to solve a indirect dependency issue where net.server was initialized before the config was read --- util/async.lua | 8 -------- 1 file changed, 8 deletions(-) (limited to 'util/async.lua') diff --git a/util/async.lua b/util/async.lua index 8b92c878..012cfd87 100644 --- a/util/async.lua +++ b/util/async.lua @@ -1,6 +1,5 @@ local log = require "util.logger".init("util.async"); local new_id = require "util.id".short; -local timer = require "util.timer"; local function checkthread() local thread, main = coroutine.running(); @@ -226,16 +225,9 @@ local function ready() return pcall(checkthread); end -local function sleep(s) - local wait, done = waiter(); - timer.add_task(s, done); - wait(); -end - return { ready = ready; waiter = waiter; guarder = guarder; runner = runner; - sleep = sleep; }; -- cgit v1.2.3