Re: How to timeout a running function??
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: How to timeout a running function??
- From: "Leo Razoumov" <slonik.az@...>
- Date: 2006年10月30日 12:26:17 -0500
Luiz,
thanks a lot for the help and pointers to the relevant Lua code! This
is exactly what I have been looking for.
Thanks and Best Regards,
--Leo--
On 10/30/06, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> How would count hook help me if my foo() functions is blocking inside?
It does not.
> Can I use lalarm to break out from Lua function? Would setjmp/longjmp
> used in alarm handler leave Lua in inconsistent state?
Like I said, you have to be careful. In the alarm handler you have to set
a hook, just that. In the hook you call error. That's what lua.c does:
http://www.lua.org/source/5.1/lua.c.html#laction
http://www.lua.org/source/5.1/lua.c.html#lstop