From 2ef29982798ff32fcb96030d24d148f0c960e085 Mon Sep 17 00:00:00 2001 From: sammyette <38820196+TorchedSammy@users.noreply.github.com> Date: Sat, 18 Sep 2021 22:48:28 -0400 Subject: [PATCH] fix: make timeout() blocking may or may not be temporary --- lua.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua.go b/lua.go index a65a5da..bac2da0 100644 --- a/lua.go +++ b/lua.go @@ -152,7 +152,8 @@ func hshgoroutine(gofunc func()) { func hshtimeout(timeoutfunc func(), ms int) { timeout := time.Duration(ms) * time.Millisecond - time.AfterFunc(timeout, timeoutfunc) + time.Sleep(timeout) + timeoutfunc() } func hshinterval(L *lua.LState) int {