diff --git a/ChangeLog b/ChangeLog index 31817a0e..70aab6ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,7 +4,8 @@ 2006-09-20 Stephane Letz - * On Windows, avoid to use the unsafe Kill thread method. Use thread Stop instead and have blocked IO be unlocked. + * On Windows, avoid to use the unsafe Kill thread method. Use thread Stop instead and have blocked IO be unlocked. + * Still get RT thread termination problems, restore a version that works on OSX and Linux with conditionnal compilation for now. 2006-09-16 Stephane Letz diff --git a/common/JackClient.cpp b/common/JackClient.cpp index 716490e7..61ea842f 100644 --- a/common/JackClient.cpp +++ b/common/JackClient.cpp @@ -188,7 +188,7 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync, res = fXrun(fXrunArg); break; - case JackNotifyChannelInterface::kZombifyClient: + case JackNotifyChannelInterface::kZombifyClient: //res = fThread->Kill(); Really neede ?? Unsafe in WIN32... JackLog("JackClient::kZombifyClient name = %s ref = %ld \n", name, refnum); ShutDown(); @@ -207,16 +207,18 @@ int JackClient::Activate() { JackLog("JackClient::Activate \n"); if (IsActive()) - return 0; - - // Done first so that the RT thread then access an allocated synchro - if (!fSynchroTable[GetClientControl()->fRefNum]->Connect(GetClientControl()->fName)) { - jack_error("Cannot ConnectSemaphore %s client", GetClientControl()->fName); - return -1; - } - - if (StartThread() < 0) - return -1; + return 0; + +#ifdef WIN32 + // Done first so that the RT thread then access an allocated synchro + if (!fSynchroTable[GetClientControl()->fRefNum]->Connect(GetClientControl()->fName)) { + jack_error("Cannot ConnectSemaphore %s client", GetClientControl()->fName); + return -1; + } +#endif + + if (StartThread() < 0) + return -1; int result = -1; fChannel->ClientActivate(GetClientControl()->fRefNum, &result); @@ -248,12 +250,13 @@ int JackClient::Deactivate() JackLog("JackClient::Deactivate res = %ld \n", result); // We need to wait for the new engine cycle before stopping the RT thread, but this is done by ClientDeactivate - - // steph - fSynchroTable[GetClientControl()->fRefNum]->Disconnect(); - fThread->Stop(); - - //fThread->Kill(); + +#ifdef WIN32 + fSynchroTable[GetClientControl()->fRefNum]->Disconnect(); + fThread->Stop(); +#else + fThread->Kill(); +#endif return result; } diff --git a/common/JackLibClient.cpp b/common/JackLibClient.cpp index f9e5c087..6e0b0864 100644 --- a/common/JackLibClient.cpp +++ b/common/JackLibClient.cpp @@ -98,13 +98,13 @@ int JackLibClient::Open(const char* name) SetupDriverSync(false); - // Connect shared synchro : the synchro must be usable in I/O mode when several clients live in the same process - /* +#ifndef WIN32 + // Connect shared synchro : the synchro must be usable in I/O mode when several clients live in the same process if (!fSynchroTable[fClientControl->fRefNum]->Connect(name)) { jack_error("Cannot ConnectSemaphore %s client", name); goto error; - } - */ + } +#endif JackLog("JackLibClient::Open name = %s refnum = %ld\n", name, fClientControl->fRefNum); return 0; diff --git a/windows/JackWinNamedPipeServerChannel.cpp b/windows/JackWinNamedPipeServerChannel.cpp index 58dcf7c3..40c2a9bc 100644 --- a/windows/JackWinNamedPipeServerChannel.cpp +++ b/windows/JackWinNamedPipeServerChannel.cpp @@ -161,7 +161,6 @@ int JackClientPipeThread::HandleRequest() JackResult res; if (req.Read(fPipe) == 0) res.fResult = fServer->GetEngine()->PortUnRegister(req.fRefNum, req.fPortIndex); - res.Write(fPipe); break; }