From 43f85a15884a344238e25c118768d36976ae783a Mon Sep 17 00:00:00 2001 From: ame Date: Tue, 7 May 2024 14:09:48 -0500 Subject: more work on threads --- tests/h.lua | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'tests/h.lua') diff --git a/tests/h.lua b/tests/h.lua index 0a0cfdd..1472c89 100644 --- a/tests/h.lua +++ b/tests/h.lua @@ -1,16 +1,18 @@ require "llib" -local th = llib.thread.async(function (res) - _G.llib.io.pprint(res) - _G.llib.io.pprint({aa=45}) - res:res(_G.llib.crypto.md5()) +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) -os.execute("sleep 1") - -print("out:") -a = th:res(); -print((a + "hi"):final()) +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) -while true do end \ No newline at end of file +print(thread_a:await()) +print(thread_b:await()) \ No newline at end of file -- cgit v1.2.3