aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/basic.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/basic.lua b/tests/basic.lua
index 5a905e7..cfe6fd5 100644
--- a/tests/basic.lua
+++ b/tests/basic.lua
@@ -142,7 +142,8 @@ if st=="done" then
142end 142end
143assert(st=="running") 143assert(st=="running")
144 144
145lane9:cancel("count", 100) -- 0 timeout, 100 instructions count hook 145-- when running under luajit, the function is JIT-ed, and the instruction count isn't hit, so we need a different hook
146lane9:cancel(jit and "line" or "count", 100) -- 0 timeout, hook triggers cancelslation when reaching the specified count
146 147
147local t0= os.time() 148local t0= os.time()
148while os.time()-t0 < 5 do 149while os.time()-t0 < 5 do
@@ -151,7 +152,7 @@ while os.time()-t0 < 5 do
151 if st~="running" then break end 152 if st~="running" then break end
152end 153end
153PRINT(" "..st) 154PRINT(" "..st)
154assert(st == "cancelled") 155assert(st == "cancelled", "st is '" .. st .. "' instead of 'cancelled'")
155 156
156-- cancellation of lanes waiting on a linda 157-- cancellation of lanes waiting on a linda
157local limited = lanes.linda("limited") 158local limited = lanes.linda("limited")