lua-users home
lua-l archive

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


Hi,

If I have a thread that is currently blocked on a lua_yield() call, is there a way to invalidate the thread (via the C API) such that it will be garbage collected?

I'm creating and destroying C++ objects that have Lua threads associated with them. When a C++ object is destroyed, it's associated Lua thread will never resume, and I suspect will never be garbage collected as a result. I'd like to avoid passing in a special parameter via the lua_resume() call to tell the thread to exit it's main loop.

I'm experiencing a crash in Lua after roughly 50 threads are orphaned as described above, and I try to create more.

Cheers,
Brian