From 05935b364a65b71a0f243bce694dd8d00e0db786 Mon Sep 17 00:00:00 2001 From: Ovidiu Mircescu Date: Thu, 7 Jun 2018 11:03:55 +0200 Subject: [PATCH] Fix potential deadlock. --- src/Local/BatchManager_Local.cxx | 3 +++ 1 file changed, 3 insertions(+) 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 << ")") ); -- 2.39.2