lua-users home
lua-l archive

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

----- Original Message -----
Date: 1/18/2012 7:04 AM
Hi All,

I've implemented a scheduler that reuses coroutines. Pretty standard stuff: spawn a new coroutine, yield, sleeping for some time, stop, wait for events.

Stop causes the current coroutine to abort and return itself to the pool of available coroutines, but I need to implement something to kill any arbitrary coroutine.

Is there a way to throw an error in another Lua thread?

Perhaps this patch may help you:

At the time, it worked for me, but I never ended up using it in production. YMMV.