lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



-----Message d'origine-----
De : lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] De la part de Benoit Germain
Envoyé : samedi 12 décembre 2009 18:18
À : Lua list
Objet : RE: my module crashes when used with lanes


> Problem solved :-)

Almost... I have several lanes with the following loop, as in this little script

require "lanes"
require "socket"

local function laneFunc( linda)
	while true
	do
		local command = linda:receive( nil, "command")
		if command == "terminate"
		then
			break
		end
	end
end

local linda = lanes.linda()

local lanegen = lanes.gen( "package", laneFunc)
local mylane = lanegen( linda)
socket.sleep(1)
print( mylane.status)

So all of them are in a pending linda receive operation. Therefore, as per documentation, their status should be "waiting". But in fact they are "running". Am I missing something obvious?