From 6de0d5453f0d7a85f3d4fc363eb960751fe2709e Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 4 Oct 2025 23:52:51 +0800 Subject: impl coroutine semaphore --- tests/modules/scheduler/semaphore.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/modules') diff --git a/tests/modules/scheduler/semaphore.lua b/tests/modules/scheduler/semaphore.lua index 097b0e360..788650019 100644 --- a/tests/modules/scheduler/semaphore.lua +++ b/tests/modules/scheduler/semaphore.lua @@ -4,8 +4,8 @@ function _loop(semaphore, id) print("[%d]: start", id) while true do print("[%d]: wait ..", id) - --semaphore:wait(-1) - os.sleep(1000) + local value = semaphore:wait(-1) + print("[%d]: -> triggered, value: %d ..", id, value) end print("[%d]: end", id) end -- cgit v1.3.1