Fix thread problem when %onprompt is defined, can cause crashes & dead-locks. 48/16748/2
Vincent COUVERT [Tue, 30 Jun 2015 15:16:35 +0000 (17:16 +0200)]
Change-Id: I3acc57cd16811a159c444d295cfe144d5e099fe6

scilab/modules/core/src/cpp/InitScilab.cpp

index c04fdd2..b5b7e12 100644 (file)
@@ -558,10 +558,10 @@ void* scilabReadAndStore(void* param)
     // unlock main thread
     ThreadManagement::SendStartPendingSignal();
 
-    callOnPrompt();
-
     while (ConfigVariable::getForceQuit() == false)
     {
+        callOnPrompt();
+
         Parser parser;
         parser.setParseTrace(_pSEI->iParseTrace != 0);
 
@@ -643,8 +643,6 @@ void* scilabReadAndStore(void* param)
         command = NULL;
 
         ThreadManagement::WaitForConsoleExecDoneSignal();
-
-        callOnPrompt();
     }
 
     // Awake scilabReadAndExecCommand thread in case of scilab exit