Reputation: 113
How to share global variables between two different lua_state?
The lua_state can not be created with lua_newthread.
Help please
Upvotes: 0
Views: 297
Reputation: 474476
You cannot directly share components from one lua_State
with another. The only cross connection you can have between lua_State
s is via the intervention of some C or C++ code. You can register the same function in multiple states, and thereby access the same resource from both. But you have to do it through functions and C/C++/etc objects, not directly through Lua.
Upvotes: 2