From c6c46faf7c9f0db31f26c2745f561fea2fb96a3e Mon Sep 17 00:00:00 2001 From: Bottinator22 Date: Mon, 10 Feb 2025 10:55:37 -0800 Subject: scriptable threads --- source/game/scripting/StarLuaComponents.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/game/scripting/StarLuaComponents.hpp') 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 m_callbacks; LuaRootPtr m_luaRoot; TrackerListenerPtr m_reloadTracker; Maybe m_context; Maybe m_error; + + StringMap> m_threads; + mutable RecursiveMutex m_threadLock; }; // Wraps a basic lua component to add a persistent storage table translated -- cgit v1.2.3