distinct functions to create/destroy states and threads

This commit is contained in:
Roberto Ierusalimschy
2002-01-11 18:26:52 -02:00
parent b7ae43d457
commit d56d4cf776
7 changed files with 144 additions and 97 deletions

6
lua.h
View File

@@ -94,8 +94,10 @@ typedef LUA_NUMBER lua_Number;
/*
** state manipulation
*/
LUA_API lua_State *lua_newthread (lua_State *L, int stacksize);
LUA_API lua_State *lua_open (int stacksize);
LUA_API void lua_close (lua_State *L);
LUA_API lua_State *lua_newthread (lua_State *L, int stacksize);
LUA_API void lua_closethread (lua_State *L, lua_State *thread);
/*
@@ -215,8 +217,6 @@ LUA_API void lua_newuserdatabox (lua_State *L, void *u);
** ===============================================================
*/
#define lua_open(n) lua_newthread(NULL, (n))
#define lua_pop(L,n) lua_settop(L, -(n)-1)
#define lua_register(L,n,f) (lua_pushcfunction(L, f), lua_setglobal(L, n))