diff options
| author | ame <[email protected]> | 2025-09-02 22:41:16 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2025-09-02 22:41:16 -0500 |
| commit | aca474d31ede34347e776504b5a4228800d0e3a8 (patch) | |
| tree | ec208c4df6f9334d7b20ffa18c4d6c3e84216306 /tests/units/thread-nested.lua | |
| parent | 2ac674735ba38c655be4f2e473b82974c76cf8c9 (diff) | |
better tests
Diffstat (limited to 'tests/units/thread-nested.lua')
| -rw-r--r-- | tests/units/thread-nested.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/units/thread-nested.lua b/tests/units/thread-nested.lua new file mode 100644 index 0000000..e0227c6 --- /dev/null +++ b/tests/units/thread-nested.lua @@ -0,0 +1,22 @@ +local mutex = llby.thread.mutex() +mutex:lock() + +local t1 = llby.thread.async(function(res) + + local t2 = llby.thread.async(function(res) + + local t3 = llby.thread.async(function(res) + mutex:lock() + + res(254) + end) + + + res(t3) + end) + + res(t2) +end) + +mutex:unlock() +return t1:await():await():await() == 254 |
