diff options
| author | ruki <[email protected]> | 2025-10-04 23:52:51 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-10-04 23:52:51 +0800 |
| commit | 6de0d5453f0d7a85f3d4fc363eb960751fe2709e (patch) | |
| tree | 728285654bf631d6373366de869df15150abb269 /tests/modules | |
| parent | e1adff76f2efecf0c82bd7a9db9ab60497be6926 (diff) | |
impl coroutine semaphore
Diffstat (limited to 'tests/modules')
| -rw-r--r-- | tests/modules/scheduler/semaphore.lua | 4 |
1 files changed, 2 insertions, 2 deletions
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 |
