[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: why write lua_unlock before lua_lock?
- From: "Mauro Iazzi" <mauro.iazzi@...>
- Date: Wed, 27 Jun 2007 17:46:36 +0200
On 27/06/07, bit bull <email@example.com> wrote:
Hello, I read lua sources at tonight. I saw this code piece:
ldump.c line 33-35:
why lua_unlock before lua_lock?
the state has already been locked during some initialization function,
but it must be unlocked because the writer could be a callback to the
Relock just after that, for thread safety.
I find lua_lock and lua_unlock defined in Llimits.h:
#define lua_lock(L) ((void) 0)
#define lua_unlock(L) ((void) 0)
I think lua_lock and lua_unlock is unusable, for new version?
who can let me know something about this?
you should define these if you need to use them (eg you are in an
actual multithreaded environment). By default they are off.
you should define them in luaconf.h, I guess. I never did: has anyone
as better advice?