Welcome Guest Search | Active Topics | Log In | Register

Script Termination
#1 Posted : Monday, April 7, 2014 8:40:04 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/26/2014(UTC)
Posts: 7
Location: HUngary

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Hope this is the right place to ask.

I need an ability to stop squirrel script from debugger or another thread.
For debugger I did it via modifying debug hook and checking return value. I do not like the fact that I changed internals but this way work quite good.

But how to stop script from another thread?
It can be variable in SQVM, let's say m_keepGoing.

SQVM::Execute will check it in the execution loop, something like:

while(keepGoing)// for(;;)
const SQInstruction &_i_ = *ci->_ip++;

If another thread reset this variable, execution will be terminated.
However this is one more extra check, which is not very nice. Probably another thread may change something else in VM ?
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Clean Slate theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.214 seconds.