Skip to content

Commit 82c48f0

Browse files
Added comment explaining possible problem with script continuing execution
1 parent 0534875 commit 82c48f0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

trikScriptRunner/src/scriptEngineWorker.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ void ScriptEngineWorker::stopScript()
128128

129129
if (mMailbox) {
130130
mMailbox->stopWaiting();
131+
/// @todo: here script will continue to execute and may execute some statements before it will eventually
132+
/// be stopped by mThreading.reset(). But if we do mThreading.reset() before mMailbox->stopWaiting(),
133+
/// we will get deadlock, since mMailbox->stopWaiting() shall be executed in already stopped thread.
134+
/// Actually we shall stop script engines here, do mMailbox->stopWaiting(), then stop threads.
131135
}
132136

133137
mThreading.reset();

0 commit comments

Comments
 (0)