summaryrefslogtreecommitdiff
path: root/Runtime/Lua/LuaBind/LuaBindVM.h
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/Lua/LuaBind/LuaBindVM.h')
-rw-r--r--Runtime/Lua/LuaBind/LuaBindVM.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/Runtime/Lua/LuaBind/LuaBindVM.h b/Runtime/Lua/LuaBind/LuaBindVM.h
index a53a707..f3a9a30 100644
--- a/Runtime/Lua/LuaBind/LuaBindVM.h
+++ b/Runtime/Lua/LuaBind/LuaBindVM.h
@@ -30,6 +30,8 @@ namespace LuaBind
void OpenLibs();
lua_State* GetMainThread();
+ void SetCurThread(lua_State* cur);
+ lua_State* GetCurThread();
lua_State* CreateThread();
State GetMainState();
@@ -42,8 +44,9 @@ namespace LuaBind
private:
static std::map<global_State*, VM*> VMs; // 通过global_State索引虚拟机,为了方便
- global_State* mGlobalState; // 虚拟机的global_State,由当前虚拟机的所有线程共享,保存注册表、管理GC
- lua_State* mMainThread; // 主线程
+ global_State* mGlobalState; // 虚拟机的global_State,由当前虚拟机的所有线程共享,保存注册表、管理GC
+ lua_State* mMainThread; // 主线程
+ lua_State* mCurThread; // 当前线程,并不是绝对准确的,在调用C函数时会设置,见LUA_BIND_STATE宏
RefTable mStrongRefTable; // 全局强引用表
RefTable mWeakRefTable; // 全局弱引用表