[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: lua_lock() question
- From: Dibyendu Majumdar <mobile@...>
- Date: Sat, 9 May 2015 11:21:01 +0100
On 9 May 2015 at 10:55, Nagaev Boris <email@example.com> wrote:
> 1. A mutex must be recursive , i.e. an owning thread can lock it
> again without being self-blocked. unlock() must be called once for
> each level of ownership acquired by a single thread before ownership
> can be acquired by another thread.
Agreed - my point was that this discipline is not being followed, i.e.
there will not be a corresponding lua_unlock() call due to the longjmp
leading to a lock that will not be released.
Lua code calls C function which calls lua_settable() - the latter
which then throws an error. Even if you have a pcall in the Lua code so that the
error is caught - you would get a missing lua_unlock() call.