diff options
| author | ame <[email protected]> | 2024-05-08 10:55:05 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2024-05-08 10:55:05 -0500 |
| commit | c562d0f9e336251f9ff599a840310835820b0461 (patch) | |
| tree | fe96557b26207bb35b9330d2886eb7ee30f82bfb /tests/h.lua | |
| parent | 4b7969b0bcce51bf86a63760950fbef002ecc872 (diff) | |
work on threads
Diffstat (limited to 'tests/h.lua')
| -rw-r--r-- | tests/h.lua | 32 |
1 files changed, 14 insertions, 18 deletions
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())
+
|
