lets say that i have got such code:
String script = @"
writeConsole("Starting.")
while true do
writeConsole("I am alive...")
sleep(1000)
end";
Lua lua = new Lua();
lua.DoString(script);
witch after executed in new thread keeps writing "I am alive..." evry second, like:
Starting.
I am alive...
I am alive...
I am alive...
.....
Is there any way to stop executing this loop (or any other lua script witch is in middle of execution at given point) from other thread ? And to reload execution of this script, so it will give output like this:
Starting.
I am alive...
I am alive...
I am alive...
Starting. // stop execution and start again in this place
I am alive...
I am alive...