aboutsummaryrefslogtreecommitdiff
path: root/tests/h.lua
diff options
context:
space:
mode:
authorame <[email protected]>2024-05-08 10:55:05 -0500
committerame <[email protected]>2024-05-08 10:55:05 -0500
commit34e6285c3d3bdb31eb476d13d4d083757a51bfe6 (patch)
treefe96557b26207bb35b9330d2886eb7ee30f82bfb /tests/h.lua
parentf98fbf1ab34a8ff17daa5d51cbbdb6185f8065f7 (diff)
work on threads
Diffstat (limited to 'tests/h.lua')
-rw-r--r--tests/h.lua32
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())
+