From c562d0f9e336251f9ff599a840310835820b0461 Mon Sep 17 00:00:00 2001 From: ame Date: Wed, 8 May 2024 10:55:05 -0500 Subject: work on threads --- tests/h.lua | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'tests/h.lua') diff --git a/tests/h.lua b/tests/h.lua index 1472c89..9cddc29 100644 --- a/tests/h.lua +++ b/tests/h.lua @@ -1,18 +1,14 @@ -require "llib" - -local thread_a = llib.thread.async(function (res) - --os.execute("sleep 1") - --print((_G.ll + "hi"):final()) - res:res(_G.llib.crypto.md5("meow")) - print("after") -end) - -local thread_b = llib.thread.async(function (res) - --os.execute("sleep 1") - --print((_G.ll + "hi"):final()) - res:res(_G.llib.crypto.sha512("meow")) - print("after") -end) - -print(thread_a:await()) -print(thread_b:await()) \ No newline at end of file +require "llib" + +llib.thread.lock(1) + +local thread_a = llib.thread.async(function (res) + --os.execute("sleep 1") + --print((_G.ll + "hi"):final()) + + res(_G.llib.crypto.md5("meow")) + print("after") +end) + +print(thread_a:await()) + -- cgit v1.2.3