diff options
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 1.53 2001/01/24 15:45:33 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 1.54 2001/01/25 16:45:36 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 | */ |
@@ -91,7 +91,7 @@ static void f_luaopen (lua_State *L, void *ud) { | |||
91 | luaX_init(L); | 91 | luaX_init(L); |
92 | luaT_init(L); | 92 | luaT_init(L); |
93 | G(L)->GCthreshold = 4*G(L)->nblocks; | 93 | G(L)->GCthreshold = 4*G(L)->nblocks; |
94 | LUA_EXIT; /* temporary exit to use the API */ | 94 | LUA_UNLOCK; /* temporary exit to use the API */ |
95 | lua_newtable(L); | 95 | lua_newtable(L); |
96 | lua_ref(L, 1); /* create registry */ | 96 | lua_ref(L, 1); /* create registry */ |
97 | lua_register(L, LUA_ERRORMESSAGE, errormessage); | 97 | lua_register(L, LUA_ERRORMESSAGE, errormessage); |
@@ -100,7 +100,7 @@ static void f_luaopen (lua_State *L, void *ud) { | |||
100 | if (lua_state == NULL) lua_state = L; /* keep first state to be opened */ | 100 | if (lua_state == NULL) lua_state = L; /* keep first state to be opened */ |
101 | lua_assert(lua_gettop(L) == 0); | 101 | lua_assert(lua_gettop(L) == 0); |
102 | #endif | 102 | #endif |
103 | LUA_ENTRY; /* go back inside */ | 103 | LUA_LOCK; /* go back inside */ |
104 | } | 104 | } |
105 | } | 105 | } |
106 | 106 | ||
@@ -108,7 +108,7 @@ static void f_luaopen (lua_State *L, void *ud) { | |||
108 | LUA_API lua_State *lua_open (lua_State *OL, int stacksize) { | 108 | LUA_API lua_State *lua_open (lua_State *OL, int stacksize) { |
109 | struct Sopen so; | 109 | struct Sopen so; |
110 | lua_State *L; | 110 | lua_State *L; |
111 | LUA_ENTRY; | 111 | LUA_LOCK; |
112 | L = luaM_new(OL, lua_State); | 112 | L = luaM_new(OL, lua_State); |
113 | if (L) { /* allocation OK? */ | 113 | if (L) { /* allocation OK? */ |
114 | L->G = NULL; | 114 | L->G = NULL; |
@@ -127,7 +127,7 @@ LUA_API lua_State *lua_open (lua_State *OL, int stacksize) { | |||
127 | L = NULL; | 127 | L = NULL; |
128 | } | 128 | } |
129 | } | 129 | } |
130 | LUA_EXIT; | 130 | LUA_UNLOCK; |
131 | return L; | 131 | return L; |
132 | } | 132 | } |
133 | 133 | ||
@@ -158,9 +158,9 @@ static void close_state (lua_State *L) { | |||
158 | 158 | ||
159 | LUA_API void lua_close (lua_State *L) { | 159 | LUA_API void lua_close (lua_State *L) { |
160 | lua_assert(L != lua_state || lua_gettop(L) == 0); | 160 | lua_assert(L != lua_state || lua_gettop(L) == 0); |
161 | LUA_ENTRY; | 161 | LUA_LOCK; |
162 | close_state(L); | 162 | close_state(L); |
163 | LUA_EXIT; | 163 | LUA_UNLOCK; |
164 | lua_assert(L != lua_state || memdebug_numblocks == 0); | 164 | lua_assert(L != lua_state || memdebug_numblocks == 0); |
165 | lua_assert(L != lua_state || memdebug_total == 0); | 165 | lua_assert(L != lua_state || memdebug_total == 0); |
166 | } | 166 | } |