public static LuaThread ToLuaThread(IntPtr L, int stackPos) { stackPos = LuaDLL.abs_index(L, stackPos); LuaDLL.lua_pushvalue(L, stackPos); int reference = LuaDLL.toluaL_ref(L); return(LuaStatic.GetLuaThread(L, reference)); }