diff options
| author | ame <[email protected]> | 2024-05-12 21:00:33 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2024-05-12 21:00:33 -0500 |
| commit | 897f5843d61cc2d827b719e27d83d7f9cff3a20e (patch) | |
| tree | 3454974aa1a4e408dd1f4ad2116788d21024c1e4 /tests | |
| parent | 2b985e277f06a7086025ab292ddb22b5ded89189 (diff) | |
memopry stuff
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/h.lua | 14 | ||||
| -rw-r--r-- | tests/s.lua | 15 |
2 files changed, 6 insertions, 23 deletions
diff --git a/tests/h.lua b/tests/h.lua index b8ccd13..c96e98e 100644 --- a/tests/h.lua +++ b/tests/h.lua @@ -1,8 +1,8 @@ require "llib"
llib.thread.lock(1)
-llib.thread.lock(2)
-llib.thread.unlock(2)
+--llib.thread.lock(2)
+--llib.thread.unlock(2)
local thread_a = llib.thread.async(function (res)
--os.execute("sleep 1")
@@ -10,21 +10,19 @@ local thread_a = llib.thread.async(function (res) print("waiting..")
llib.thread.lock(1)
print("signal!")
- res(_G.llib.crypto.md5())
+ res()
print("after")
end)
os.execute("sleep 1")
+print("unlock")
llib.thread.unlock(1)
+
awa = thread_a:await()
+--print((awa + "hi"):final())
os.execute("sleep 1")
-for i=1,999 do
-print((awa + "hi"):final())
-end
-
thread_a:clean()
print("clean exit")
-
diff --git a/tests/s.lua b/tests/s.lua index a543ff0..bac5072 100644 --- a/tests/s.lua +++ b/tests/s.lua @@ -1,17 +1,2 @@ require "llib"
-function _G.sleep (a)
- local sec = tonumber(os.clock() + a);
- while (os.clock() < sec) do
- end
-end
-for i=1,50 do
- llib.net.spawn(function()
- local sec = tonumber(os.clock() + 1);
- while (os.clock() < sec) do
- end
- print("hi")
- end)
-end
-
-while true do end
\ No newline at end of file |
