From be6d0fa95cccad5aa868694c19ffc5182db88cd5 Mon Sep 17 00:00:00 2001 From: Todd Naugle Date: Thu, 27 May 2021 15:13:40 -0500 Subject: [PATCH] Do not use named semaphores on Windows since they are system wide https://docs.microsoft.com/en-us/dotnet/standard/threading/semaphore-and-semaphoreslim#named-semaphores Running multiple instances of Ardour or Ardour/Mixbus would fail in very odd ways since they would signal each other. Unnamed sems are correct for this use case. --- libs/pbd/semutils.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/pbd/semutils.cc b/libs/pbd/semutils.cc index 57f89d0afb..61888c66ed 100644 --- a/libs/pbd/semutils.cc +++ b/libs/pbd/semutils.cc @@ -25,7 +25,8 @@ using namespace PBD; Semaphore::Semaphore (const char* name, int val) { #ifdef WINDOWS_SEMAPHORE - if ((_sem = CreateSemaphore(NULL, val, 32767, name)) == NULL) { + (void) name; /* stop warning */ + if ((_sem = CreateSemaphore(NULL, val, 32767, NULL)) == NULL) { throw failed_constructor (); }