From: John L. <jla...@gm...> - 2006-08-16 21:53:16
|
On 8/16/06, hel...@gm... <hel...@gm...> wrote: > Hello, > one more question on wxLua in a multi-threading application (several threads should host their own Lua instance). > I create a wxLuaState object for every thread and use RunFile to execute the script. > After calling "RunFile" I loose control and have to wait until the script ends. > Is there a possibility to abort the script execution by the hosting application/thread? Maybe by sending an event or something to wxLua? Try using wxLuaState::SetDebugHookBreak or at least see the code in modules/wxlua/wxlstate.cpp which sets the debug hook function to wxLua_lua_debugHookFunction which you can use as a template of how to jump into a lua program while it's running. Just replace the code in wxLuaState::SetDebugHookBreak to have the lua_State hook into your own debug function. I am not too familiar with coroutines, but these might also be helpful. Regards, John Labenski |