diff options
| author | ame <[email protected]> | 2024-05-07 14:09:48 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2024-05-07 14:09:48 -0500 |
| commit | 3200f04de946049e950c6f7fd1e9d4d2f599c9ea (patch) | |
| tree | 68a9e2f5e2f496fc630d036fd27f2aae9fb2ad23 /tests/h.lua | |
| parent | a571dd1ac9fc4d46e0bbc95a3ab88f52ee37b1a1 (diff) | |
more work on threads
Diffstat (limited to 'tests/h.lua')
| -rw-r--r-- | tests/h.lua | 22 |
1 files changed, 12 insertions, 10 deletions
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 |
