[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: why write lua_unlock before lua_lock?
- From: julien.hamaide@...
- Date: Wed, 27 Jun 2007 22:48:35 +0200 (CEST)
So I understand why this problem appeared in my code. I'm using ldump
directly from user code to dump the code, there is then no lua_lock before
entering the dump function. This function is not declared in lua.h, I
needed the ldump.h to be able to call it.
Having a "public" function that does the lock should fix the problem? (I
know that this function is called using a pcall in luac, lua_lock beeing
then already call )
>> - I thinks the code in ldump is buggy.
> ldump.c does unlock before calling the user-supplied writer function.
> lundump.c does the same (in luaZ_fill). Every time you enter userland
> you need to unlock; it's like a Lua API function returning.