lua-users home
lua-l archive

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


To stop a lua coroutine, the documentation only mentions yield() ... or the
return from the main coroutine function.  But I would like the ability to
externally stop or terminate a coroutine.  For example, if I simply set the
coroutine variable to nil, will Lua understand to kill the coroutine
(regardless if it is yielded or not) and clean up its stack, all in a
graceful fashion?

Most likely I will attempt this "kill" from C++ rather than from within Lua.
But knowing how to address this from lua or C++ would be helpful.

Thanks,

-Brent