From: Ovidiu Mircescu Date: Thu, 7 Jun 2018 09:03:55 +0000 (+0200) Subject: Fix potential deadlock. X-Git-Tag: V2_4_1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=05935b364a65b71a0f243bce694dd8d00e0db786;p=tools%2Flibbatch.git Fix potential deadlock. --- diff --git a/src/Local/BatchManager_Local.cxx b/src/Local/BatchManager_Local.cxx index c2c85e0..e770599 100644 --- a/src/Local/BatchManager_Local.cxx +++ b/src/Local/BatchManager_Local.cxx @@ -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 << ")") );