From d81558291e51158b7f32bdc6f2e3f0b9124079ef Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 4 Mar 2016 08:45:03 -0500 Subject: [PATCH] Handle multiple context menu selections - Move semaphore release Current process is as follows: 1. Invoked .exe gets the semaphore 2. Invoked .exe sets `InstanceProxy` values in running exe 3. Invoked .exe causes thread to spawn in running exe 4. New thread in running .exe reads values from `InstanceProxy` 4. Invoked .exe release the semaphore The problem is that there is no guarantee on how fast new threads in running .exe will spawn and read values from `InstanceProxy`. This PR addresses that by moving the semaphore release from the invoked .exe to the thread spawned in running .exe. --- .../SingleInstanceApplication/ApplicationInstanceManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShareX.HelpersLib/SingleInstanceApplication/ApplicationInstanceManager.cs b/ShareX.HelpersLib/SingleInstanceApplication/ApplicationInstanceManager.cs index dfe677101..7a2af208e 100644 --- a/ShareX.HelpersLib/SingleInstanceApplication/ApplicationInstanceManager.cs +++ b/ShareX.HelpersLib/SingleInstanceApplication/ApplicationInstanceManager.cs @@ -54,8 +54,6 @@ public static bool CreateSingleInstance(string name, EventHandler