lua-users home
lua-l archive

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


Hi

in lua5.1 manual:

lua_newthread
          lua_State *lua_newthread (lua_State *L);
There is no explicit function to close or to destroy a thread. Threads are
subject to garbage collection, like any Lua object

	I don't understand this , for example like Npc in a game
	
	function AI()
		while(true) do
			walkto(A)
			walkto(B)
			...
			walkto(Z)
		end
	end
	
	I bind each npc with a lua_State by lua_newthread

	but the npc will die and i should close the lua_State , but I can
not. 
	what can I do ? or some better suggestion ?

Best Regards
mos