aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ltests.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/ltests.h b/ltests.h
index 5ae9cb8e..0f754917 100644
--- a/ltests.h
+++ b/ltests.h
@@ -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
58extern int islocked; 62extern 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