diff options
| author | ame <[email protected]> | 2025-11-14 02:06:22 -0600 |
|---|---|---|
| committer | ame <[email protected]> | 2025-11-14 02:06:22 -0600 |
| commit | a0e9b343216b2062134b86521a74286e10703015 (patch) | |
| tree | 62571f63c0e2773c719b9f4de8d9b583468789ac /tests/units/thread-infinite.lua | |
| parent | 5d88c4a2b80060290467d84033082f3af0c333b2 (diff) | |
sleep and thread fixes
Diffstat (limited to 'tests/units/thread-infinite.lua')
| -rw-r--r-- | tests/units/thread-infinite.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/units/thread-infinite.lua b/tests/units/thread-infinite.lua new file mode 100644 index 0000000..b3183f9 --- /dev/null +++ b/tests/units/thread-infinite.lua @@ -0,0 +1,23 @@ +local pass = llby.thread.buffer(true) + +local th = llby.thread.async(function(res) + while true do + res:testclose() + end +end) + +local readyb = llby.thread.buffer(false) + +local th2 = llby.thread.async(function(res) + llby.thread.usleep(1000 * 1000) + if not readyb:get() then + pass:set(false) + th:kill() + end +end) + +th:close() +readyb:set(true) +th2:await() + +return pass:get() |
