Is there a way to safely stop a running JsEnv? #2054
-
|
We have our javascript based game loop constantly running in a separate thread. We have recently encountered a bug in our code where the script hangs in an infinite loop. We would like to be able to detect that and shut down the JsEnv completely. Detection is easy, we just record the time last tick started and see if it took more than any reasonable time (i.e. 30 seconds). However shutting it down is a problem. Per my understanding, jsEnv.Dispose() can't be called when an isolate is currently entered. Moreover, since the thread is still running, we can't even pass a message to it. Is there a way to safely force dispose an environment (it's fine if the current call exits with an exception) from another thread? My understanding that there is Isolate::TerminateExecution API in V8, but I don't think it's implemented in puerts |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Can you stop the thread accessing JsEnv? For example, by using Thread.Abort to terminate the thread? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
added:
ff66d3d ~ a8cd6af