Skip to content

Conversation

@ab9rf
Copy link
Member

@ab9rf ab9rf commented Dec 31, 2024

This moves the global Lua state from a static global in LuaTools.h to a member variable of the singleton Core. A public accessor, getLuaState, is added to Core to provide access. This accessor includes an assertion which guarantees that only threads that hold the core mutex attempt to acquire the core lua state. Passing true to getLuaState will bypass the assertion; this should only be used in code that is guaranteed to acquire a CoreSuspender before trying to use the acquired Lua state.

split `CoreDefs.h` from `Core.h` to keep `Core` from being loaded into `RemoteClient`
@ab9rf ab9rf force-pushed the lua-state-in-core branch from 37af5ff to 9483459 Compare December 31, 2024 04:24
@myk002 myk002 merged commit b564975 into DFHack:develop Jan 1, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants