From 4db6f20770ff3953a4e7472116e9158d4d584d2c Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 19 Apr 2010 14:40:13 -0300 Subject: ensure that 'luai_userstatethread' is always called (even if 'stack_init' throws a memory error) --- ltests.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ltests.h') diff --git a/ltests.h b/ltests.h index 27dd9836..73676f64 100644 --- a/ltests.h +++ b/ltests.h @@ -1,5 +1,5 @@ /* -** $Id: ltests.h,v 2.30 2010/01/11 17:33:09 roberto Exp roberto $ +** $Id: ltests.h,v 2.31 2010/04/12 16:07:29 roberto Exp roberto $ ** Internal Header for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -62,6 +62,8 @@ struct L_EXTRA { int lock; int *plock; }; #define luai_userstateopen(l) \ (getlock(l)->lock = 0, getlock(l)->plock = &(getlock(l)->lock)) #define luai_userstatethread(l,l1) (getlock(l1)->plock = getlock(l)->plock) +#define luai_userstatefree(l,l1) \ + lua_assert(getlock(l)->plock == getlock(l1)->plock) #define lua_lock(l) lua_assert((*getlock(l)->plock)++ == 0) #define lua_unlock(l) lua_assert(--(*getlock(l)->plock) == 0) -- cgit v1.2.3-55-g6feb