diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basic.lua | 5 |
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 | |||
142 | end | 142 | end |
143 | assert(st=="running") | 143 | assert(st=="running") |
144 | 144 | ||
145 | lane9: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 |
146 | lane9:cancel(jit and "line" or "count", 100) -- 0 timeout, hook triggers cancelslation when reaching the specified count | ||
146 | 147 | ||
147 | local t0= os.time() | 148 | local t0= os.time() |
148 | while os.time()-t0 < 5 do | 149 | while 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 |
152 | end | 153 | end |
153 | PRINT(" "..st) | 154 | PRINT(" "..st) |
154 | assert(st == "cancelled") | 155 | assert(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 |
157 | local limited = lanes.linda("limited") | 158 | local limited = lanes.linda("limited") |