|
@@ -149,6 +149,14 @@ LUA_API lua_State *lua_newthread (lua_State *L) {
|
|
|
return L1;
|
|
return L1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/* Modified by Aster Jian for Urho3D */
|
|
|
|
|
+LUA_API lua_State *lua_getmainthread (lua_State* L) {
|
|
|
|
|
+ lua_State* L1;
|
|
|
|
|
+ lua_lock(L);
|
|
|
|
|
+ L1 = G(L)->mainthread;
|
|
|
|
|
+ lua_unlock(L);
|
|
|
|
|
+ return L1;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -211,7 +219,7 @@ LUA_API void lua_replace (lua_State *L, int idx) {
|
|
|
api_checkvalidindex(L, o);
|
|
api_checkvalidindex(L, o);
|
|
|
if (idx == LUA_ENVIRONINDEX) {
|
|
if (idx == LUA_ENVIRONINDEX) {
|
|
|
Closure *func = curr_func(L);
|
|
Closure *func = curr_func(L);
|
|
|
- api_check(L, ttistable(L->top - 1));
|
|
|
|
|
|
|
+ api_check(L, ttistable(L->top - 1));
|
|
|
func->c.env = hvalue(L->top - 1);
|
|
func->c.env = hvalue(L->top - 1);
|
|
|
luaC_barrier(L, func, L->top - 1);
|
|
luaC_barrier(L, func, L->top - 1);
|
|
|
}
|
|
}
|
|
@@ -771,7 +779,7 @@ LUA_API int lua_setfenv (lua_State *L, int idx) {
|
|
|
|
|
|
|
|
#define checkresults(L,na,nr) \
|
|
#define checkresults(L,na,nr) \
|
|
|
api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)))
|
|
api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)))
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
LUA_API void lua_call (lua_State *L, int nargs, int nresults) {
|
|
LUA_API void lua_call (lua_State *L, int nargs, int nresults) {
|
|
|
StkId func;
|
|
StkId func;
|