Commit 780e0439 authored by sletz's avatar sletz
Browse files

Reworked Torben Hohn fix for server restart issue on Windows.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3537 0c269be4-1314-0410-8aa9-9f06e86f4224
parent e9fc6c62
......@@ -25,6 +25,10 @@ Paul Davis
Jackdmp changes log
---------------------------
2009-05-13 Stephane Letz <letz@grame.fr>
* Reworked Torben Hohn fix for server restart issue on Windows.
2009-05-11 Stephane Letz <letz@grame.fr>
* New jack_free function added in jack.h.
......
......@@ -311,7 +311,6 @@ bool JackWinNamedPipeClientChannel::Execute()
JackResult res;
if (event.Read(&fNotificationListenPipe) < 0) {
fNotificationListenPipe.Close();
jack_error("JackWinNamedPipeClientChannel read fail");
goto error;
}
......@@ -320,7 +319,6 @@ bool JackWinNamedPipeClientChannel::Execute()
if (event.fSync) {
if (res.Write(&fNotificationListenPipe) < 0) {
fNotificationListenPipe.Close();
jack_error("JackWinNamedPipeClientChannel write fail");
goto error;
}
......@@ -328,6 +326,9 @@ bool JackWinNamedPipeClientChannel::Execute()
return true;
error:
// Close the pipes, server wont be able to create them otherwise.
fNotificationListenPipe.Close();
fRequestPipe.Close();
fClient->ShutDown();
return false;
}
......
......@@ -137,9 +137,9 @@ bool JackWinSemaphore::Allocate(const char* name, const char* server_name, int v
return false;
} else if (GetLastError() == ERROR_ALREADY_EXISTS) {
jack_error("Allocate: named semaphore already exist name = %s", fName);
CloseHandle(fSemaphore);
fSemaphore = NULL;
return false;
// Try to open it
fSemaphore = OpenSemaphore(SEMAPHORE_ALL_ACCESS, FALSE, fName);
return (fSemaphore != NULL);
} else {
return true;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment