Closed GoogleCodeExporter closed 9 years ago
I can not reproduce it.
Can you try creating a test file called bug13.lua inside kahlua/testsuite/
containing
your example code?
You can then test it with:
ant -Dtest.file=bug13.lua
I tried with this code but the test passed, can you see if I did anything wrong
in
the test?
-- Setup necessary for the test to run
functionCounter = 0
function JavaFunction1()
functionCounter = functionCounter + 1
if functionCounter < 10 then
return 0
end
return 1
end
function2Counter = 0
function JavaFunction2()
function2Counter = function2Counter + 1
-- simulate some work
pcall(function() end)
end
local function waitproc()
local s = 0
while s == 0 do
coroutine.yield( 1 )
s = JavaFunction1()
end
end
local function init(v)
JavaFunction2()
waitproc() -- LuaState halt
JavaFunction2()
waitproc()
return 0
end
function Construct()
cofunc = coroutine.create(init)
end
function Loop()
local r, v
if cofunc ~= nil then
r , v = coroutine.resume(cofunc)
if v == 0 then
cofunc = nil
return 1;
end
end
return 0
end
-- run the test
Construct()
while Loop() == 0 do
end
assert(function2Counter == 2)
Original comment by kristofer.karlsson@gmail.com
on 27 Apr 2009 at 12:06
I'm going to mark this invalid until I am able to reproduce it.
This could be simplified if you sent me code that can be run which proves the
bug.
Original comment by kristofer.karlsson@gmail.com
on 1 May 2009 at 12:15
Original issue reported on code.google.com by
dea...@yahoo.co.jp
on 27 Apr 2009 at 11:28