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 | 43f85a15884a344238e25c118768d36976ae783a (patch) | |
| tree | 68a9e2f5e2f496fc630d036fd27f2aae9fb2ad23 /tests | |
| parent | 618263f6f85d08bfd85d4f0376663aa1e2f58eac (diff) | |
more work on threads
Diffstat (limited to 'tests')
| -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 |
