blob: 6a9f7aaf8c7a4cedff368ab878b4b4db8e314d5e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
--
-- Test case for hang on [1]s and :join()s.
--
local lanes = require "lanes"
lanes.configure()
local function ret(b)
return b
end
local lgen = lanes.gen("*", {}, ret)
for i=1,10000 do
local ln = lgen(i)
print( "getting result for "..i )
-- Hangs here forever every few hundred runs or so,
-- can be illustrated by putting another print() statement
-- after, which will never be called.
--
local result = ln[1];
assert (result == i);
end
print "Finished!"
|