Skip to content

Commit

Permalink
Added comment explaining possible problem with script continuing exec…
Browse files Browse the repository at this point in the history
…ution
  • Loading branch information
yurii-litvinov committed Nov 5, 2015
1 parent 0534875 commit 82c48f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions trikScriptRunner/src/scriptEngineWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ void ScriptEngineWorker::stopScript()

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

mThreading.reset();
Expand Down

0 comments on commit 82c48f0

Please sign in to comment.