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 | 34e6285c3d3bdb31eb476d13d4d083757a51bfe6 (patch) | |
| tree | fe96557b26207bb35b9330d2886eb7ee30f82bfb /tests | |
| parent | f98fbf1ab34a8ff17daa5d51cbbdb6185f8065f7 (diff) | |
work on threads
Diffstat (limited to 'tests')
| -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())
+
|
