From 710c93d74b7cf9ebe6498219c5876114e954a003 Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Thu, 18 Jan 2024 11:03:33 +0100 Subject: [PATCH] Fix not scheduling when done in main.luau --- src/main.luau | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.luau b/src/main.luau index 7a399ec..742f14e 100644 --- a/src/main.luau +++ b/src/main.luau @@ -1,5 +1,6 @@ for i = 1, 5 do print("iteration " .. tostring(i) .. " of 5") + local thread = coroutine.running() local counter = 0 for j = 1, 10_000 do @@ -8,10 +9,10 @@ for i = 1, 5 do counter += 1 if counter == 10_000 then print("completed iteration " .. tostring(i) .. " of 5") + spawn(thread) end end) end - -- FIXME: This resumes instantly with mlua "async" feature coroutine.yield() end