diff options
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 1.56 2001/02/02 15:13:05 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 1.57 2001/02/23 17:17:25 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -93,7 +93,7 @@ static void f_luaopen (lua_State *L, void *ud) { | |||
93 | LUA_API lua_State *lua_open (lua_State *OL, int stacksize) { | 93 | LUA_API lua_State *lua_open (lua_State *OL, int stacksize) { |
94 | struct Sopen so; | 94 | struct Sopen so; |
95 | lua_State *L; | 95 | lua_State *L; |
96 | if (OL) LUA_LOCK(OL); | 96 | if (OL) lua_lock(OL); |
97 | L = luaM_new(OL, lua_State); | 97 | L = luaM_new(OL, lua_State); |
98 | if (L) { /* allocation OK? */ | 98 | if (L) { /* allocation OK? */ |
99 | L->G = NULL; | 99 | L->G = NULL; |
@@ -112,7 +112,7 @@ LUA_API lua_State *lua_open (lua_State *OL, int stacksize) { | |||
112 | L = NULL; | 112 | L = NULL; |
113 | } | 113 | } |
114 | } | 114 | } |
115 | if (OL) LUA_UNLOCK(OL); | 115 | if (OL) lua_unlock(OL); |
116 | return L; | 116 | return L; |
117 | } | 117 | } |
118 | 118 | ||
@@ -141,11 +141,11 @@ static void close_state (lua_State *L, lua_State *OL) { | |||
141 | LUA_API void lua_close (lua_State *L) { | 141 | LUA_API void lua_close (lua_State *L) { |
142 | lua_State *OL; | 142 | lua_State *OL; |
143 | lua_assert(L != lua_state || lua_gettop(L) == 0); | 143 | lua_assert(L != lua_state || lua_gettop(L) == 0); |
144 | LUA_LOCK(L); | 144 | lua_lock(L); |
145 | OL = L->next; /* any surviving thread (if there is one) */ | 145 | OL = L->next; /* any surviving thread (if there is one) */ |
146 | if (OL == L) OL = NULL; /* no surviving threads */ | 146 | if (OL == L) OL = NULL; /* no surviving threads */ |
147 | close_state(L, OL); | 147 | close_state(L, OL); |
148 | if (OL) LUA_UNLOCK(OL); /* cannot unlock over a freed state */ | 148 | if (OL) lua_unlock(OL); /* cannot unlock over a freed state */ |
149 | lua_assert(L != lua_state || memdebug_numblocks == 0); | 149 | lua_assert(L != lua_state || memdebug_numblocks == 0); |
150 | lua_assert(L != lua_state || memdebug_total == 0); | 150 | lua_assert(L != lua_state || memdebug_total == 0); |
151 | } | 151 | } |