diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-02-11 08:20:00 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-11 08:20:00 +1100 |
commit | 345865931c3c36b4c467e5366ef36611f996acb1 (patch) | |
tree | 6552c16524f3e756140d7c2a5bfde15c2faaa810 /source/game/scripting/StarLuaComponents.hpp | |
parent | 9eae03a968d0b2294d09d831a972cc3bbcae59c6 (diff) | |
parent | c6c46faf7c9f0db31f26c2745f561fea2fb96a3e (diff) |
Merge pull request #182 from Bottinator22/scriptablethreads
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 |