lua-users home
lua-l archive

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



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, but it seems to trigger garbage collection prematurely in other threads. I also tried setting the thread to nil in the global environment, but this doesn't trigger collection.

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

Thanks.