aboutsummaryrefslogtreecommitdiff
path: root/ltests.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-10-25 17:05:28 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-10-25 17:05:28 -0300
commit96e15b8501e5d8fc40c475cbac573f910ab5853b (patch)
tree2c8efededa6849704f0db3075d0cbe0efaa40b2d /ltests.h
parent0fd91b1b087b478fffa36f96bc0f608d86627a4b (diff)
downloadlua-96e15b8501e5d8fc40c475cbac573f910ab5853b.tar.gz
lua-96e15b8501e5d8fc40c475cbac573f910ab5853b.tar.bz2
lua-96e15b8501e5d8fc40c475cbac573f910ab5853b.zip
threads now are real Lua objects, subject to garbage collection
Diffstat (limited to 'ltests.h')
-rw-r--r--ltests.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/ltests.h b/ltests.h
index 12ad9dcf..885d9235 100644
--- a/ltests.h
+++ b/ltests.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.h,v 1.15 2002/07/17 16:25:13 roberto Exp roberto $ 2** $Id: ltests.h,v 1.16 2002/10/08 18:45:07 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*/
@@ -42,10 +42,11 @@ void *debug_realloc (void *block, size_t oldsize, size_t size);
42 42
43/* test for lock/unlock */ 43/* test for lock/unlock */
44extern int islocked; 44extern int islocked;
45#define LUA_USERSTATE int *lock; 45#define LUA_USERSTATE int *
46#define lua_userstateopen(l) if (l != NULL) *cast(int **, l) = &islocked; 46#define getlock(l) (*(cast(int **, l) - 1))
47#define lua_lock(L) lua_assert((**cast(int **, L))++ == 0) 47#define lua_userstateopen(l) if (l != NULL) getlock(l) = &islocked;
48#define lua_unlock(L) lua_assert(--(**cast(int **, L)) == 0) 48#define lua_lock(l) lua_assert((*getlock(l))++ == 0)
49#define lua_unlock(l) lua_assert(--(*getlock(l)) == 0)
49 50
50 51
51int luaB_opentests (lua_State *L); 52int luaB_opentests (lua_State *L);