aboutsummaryrefslogtreecommitdiff
path: root/ltests.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-04-19 14:40:13 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-04-19 14:40:13 -0300
commit4db6f20770ff3953a4e7472116e9158d4d584d2c (patch)
treed29547858619d1c3973a5a4c3599b993793798b2 /ltests.h
parentcca71912e6c884c7a2fcf45c19d15e5d69810c97 (diff)
downloadlua-4db6f20770ff3953a4e7472116e9158d4d584d2c.tar.gz
lua-4db6f20770ff3953a4e7472116e9158d4d584d2c.tar.bz2
lua-4db6f20770ff3953a4e7472116e9158d4d584d2c.zip
ensure that 'luai_userstatethread' is always called (even if
'stack_init' throws a memory error)
Diffstat (limited to 'ltests.h')
-rw-r--r--ltests.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/ltests.h b/ltests.h
index 27dd9836..73676f64 100644
--- a/ltests.h
+++ b/ltests.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.h,v 2.30 2010/01/11 17:33:09 roberto Exp roberto $ 2** $Id: ltests.h,v 2.31 2010/04/12 16:07:29 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*/
@@ -62,6 +62,8 @@ struct L_EXTRA { int lock; int *plock; };
62#define luai_userstateopen(l) \ 62#define luai_userstateopen(l) \
63 (getlock(l)->lock = 0, getlock(l)->plock = &(getlock(l)->lock)) 63 (getlock(l)->lock = 0, getlock(l)->plock = &(getlock(l)->lock))
64#define luai_userstatethread(l,l1) (getlock(l1)->plock = getlock(l)->plock) 64#define luai_userstatethread(l,l1) (getlock(l1)->plock = getlock(l)->plock)
65#define luai_userstatefree(l,l1) \
66 lua_assert(getlock(l)->plock == getlock(l1)->plock)
65#define lua_lock(l) lua_assert((*getlock(l)->plock)++ == 0) 67#define lua_lock(l) lua_assert((*getlock(l)->plock)++ == 0)
66#define lua_unlock(l) lua_assert(--(*getlock(l)->plock) == 0) 68#define lua_unlock(l) lua_assert(--(*getlock(l)->plock) == 0)
67 69