lua-users home
lua-l archive

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



On Mar 25, 2007, at 8:33 PM, Rici Lake wrote:

Graham Wakefield wrote:
Hi,
I'm having some hard to understand behavior; I create new threads using lua_newthread, and lua_resume them periodically from C++.  However, I may wish to at some point terminate a thread before it has completed; I tried calling lua_close() on the thread's lua_State,

You can't call lua_close() on a thread; only on the main state.

Ah, no wonder it crashes!  

Is there a way to terminate a yielded thread, freeing any resources it was (uniquely) using, whilst leaving other (related) lua states intact?

Not really, other than just removing all references to the thread and waiting for the garbage collector to deal with it.

OK, thanks!