diff options
author | Bottinator22 <bottinator22@gmail.com> | 2025-02-10 10:55:37 -0800 |
---|---|---|
committer | Bottinator22 <bottinator22@gmail.com> | 2025-02-10 13:13:19 -0800 |
commit | c6c46faf7c9f0db31f26c2745f561fea2fb96a3e (patch) | |
tree | a1857a9d887cac72ed3121de9d443d0716b39c8c /source/game/scripting/StarLuaComponents.hpp | |
parent | eef0da37e1b206a9d486c5ad74bb10b11944503b (diff) |
scriptable threads
Diffstat (limited to 'source/game/scripting/StarLuaComponents.hpp')
-rw-r--r-- | source/game/scripting/StarLuaComponents.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/game/scripting/StarLuaComponents.hpp b/source/game/scripting/StarLuaComponents.hpp index e3d1d20..b6c19ac 100644 --- a/source/game/scripting/StarLuaComponents.hpp +++ b/source/game/scripting/StarLuaComponents.hpp @@ -10,6 +10,8 @@ namespace Star { STAR_EXCEPTION(LuaComponentException, LuaException); +STAR_CLASS(ScriptableThread); + // Basic lua component that can be initialized (takes and then owns a script // context, calls the script context's init function) and uninitialized // (releases the context, calls the context 'uninit' function). @@ -94,12 +96,17 @@ protected: bool checkInitialization(); private: + LuaCallbacks makeThreadsCallbacks(); + StringList m_scripts; StringMap<LuaCallbacks> m_callbacks; LuaRootPtr m_luaRoot; TrackerListenerPtr m_reloadTracker; Maybe<LuaContext> m_context; Maybe<String> m_error; + + StringMap<shared_ptr<ScriptableThread>> m_threads; + mutable RecursiveMutex m_threadLock; }; // Wraps a basic lua component to add a persistent storage table translated |