lua-users home
lua-l archive

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

On 9 May 2015 at 10:55, Nagaev Boris <> wrote:
> 1. A mutex must be recursive [1], 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.

For example:

Lua code calls C function which calls lua_settable() - the latter
calls luaV_settable()
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.