[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to timeout a running function??
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 30 Oct 2006 10:37:48 -0300
> 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