diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-06-02 16:09:21 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-06-02 16:09:21 -0300 |
| commit | ba9878fcb8ea64bf582c561ed0f472fd6fd0d850 (patch) | |
| tree | 197598dbd448481673666ec65ceb47655e24342e | |
| parent | fa38421cea9f92e643e7598fa5ea6f6efc3e53ee (diff) | |
| download | lua-ba9878fcb8ea64bf582c561ed0f472fd6fd0d850.tar.gz lua-ba9878fcb8ea64bf582c561ed0f472fd6fd0d850.tar.bz2 lua-ba9878fcb8ea64bf582c561ed0f472fd6fd0d850.zip | |
lock stuff defined in `luaconf.h'
| -rw-r--r-- | ltests.h | 8 |
1 files changed, 6 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.h,v 2.4 2004/04/30 20:13:38 roberto Exp roberto $ | 2 | ** $Id: ltests.h,v 2.5 2004/05/03 12:28:43 roberto Exp roberto $ |
| 3 | ** Internal Header for Debugging of the Lua Implementation | 3 | ** Internal Header for Debugging of the Lua Implementation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -55,10 +55,14 @@ int lua_checkmemory (lua_State *L); | |||
| 55 | 55 | ||
| 56 | 56 | ||
| 57 | /* test for lock/unlock */ | 57 | /* test for lock/unlock */ |
| 58 | #undef lua_userstateopen | ||
| 59 | #undef lua_lock | ||
| 60 | #undef lua_unlock | ||
| 61 | |||
| 58 | extern int islocked; | 62 | extern int islocked; |
| 59 | #define LUA_USERSTATE int * | 63 | #define LUA_USERSTATE int * |
| 60 | #define getlock(l) (*(cast(LUA_USERSTATE *, l) - 1)) | 64 | #define getlock(l) (*(cast(LUA_USERSTATE *, l) - 1)) |
| 61 | #define lua_userstateopen(l) if (l != NULL) getlock(l) = &islocked; | 65 | #define lua_userstateopen(l) getlock(l) = &islocked; |
| 62 | #define lua_lock(l) lua_assert((*getlock(l))++ == 0) | 66 | #define lua_lock(l) lua_assert((*getlock(l))++ == 0) |
| 63 | #define lua_unlock(l) lua_assert(--(*getlock(l)) == 0) | 67 | #define lua_unlock(l) lua_assert(--(*getlock(l)) == 0) |
| 64 | 68 | ||
