Salome HOME
Fix potential deadlock.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 7 Jun 2018 09:03:55 +0000 (11:03 +0200)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 7 Jun 2018 09:03:55 +0000 (11:03 +0200)
src/Local/BatchManager_Local.cxx

index c2c85e0f564cc4e9697ad54295821c86b8b28281..e770599f709538ead9e5cb77ebb9c1a80e54de0d 100644 (file)
@@ -464,7 +464,10 @@ namespace Batch {
     child = p_ta->launchWin32ChildProcess();
     p_ta->pere(child);
 #else
+    // LOCK&UNLOCK needed to avoid potential deadlock if a thread holds the lock
+    LOCK_IO
     child = fork();
+    UNLOCK_IO
     if (child < 0) { // erreur
       UNDER_LOCK( LOG("Fork impossible (rc=" << child << ")") );