Browse Source

Still get RT thread termination problems, restore a version that works on OSX and Linux with conditionnal compilation for now

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1244 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.59
sletz 19 years ago
parent
commit
df8b08da44
4 changed files with 26 additions and 23 deletions
  1. +2
    -1
      ChangeLog
  2. +20
    -17
      common/JackClient.cpp
  3. +4
    -4
      common/JackLibClient.cpp
  4. +0
    -1
      windows/JackWinNamedPipeServerChannel.cpp

+ 2
- 1
ChangeLog View File

@@ -4,7 +4,8 @@
2006-09-20 Stephane Letz <letz@grame.fr> 2006-09-20 Stephane Letz <letz@grame.fr>
* 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 <letz@grame.fr> 2006-09-16 Stephane Letz <letz@grame.fr>


+ 20
- 17
common/JackClient.cpp View File

@@ -188,7 +188,7 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync,
res = fXrun(fXrunArg); res = fXrun(fXrunArg);
break; break;


case JackNotifyChannelInterface::kZombifyClient:
case JackNotifyChannelInterface::kZombifyClient:
//res = fThread->Kill(); Really neede ?? Unsafe in WIN32... //res = fThread->Kill(); Really neede ?? Unsafe in WIN32...
JackLog("JackClient::kZombifyClient name = %s ref = %ld \n", name, refnum); JackLog("JackClient::kZombifyClient name = %s ref = %ld \n", name, refnum);
ShutDown(); ShutDown();
@@ -207,16 +207,18 @@ int JackClient::Activate()
{ {
JackLog("JackClient::Activate \n"); JackLog("JackClient::Activate \n");
if (IsActive()) 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; int result = -1;
fChannel->ClientActivate(GetClientControl()->fRefNum, &result); fChannel->ClientActivate(GetClientControl()->fRefNum, &result);
@@ -248,12 +250,13 @@ int JackClient::Deactivate()


JackLog("JackClient::Deactivate res = %ld \n", result); 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 // 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; return result;
} }


+ 4
- 4
common/JackLibClient.cpp View File

@@ -98,13 +98,13 @@ int JackLibClient::Open(const char* name)


SetupDriverSync(false); 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)) { if (!fSynchroTable[fClientControl->fRefNum]->Connect(name)) {
jack_error("Cannot ConnectSemaphore %s client", name); jack_error("Cannot ConnectSemaphore %s client", name);
goto error; goto error;
}
*/
}
#endif


JackLog("JackLibClient::Open name = %s refnum = %ld\n", name, fClientControl->fRefNum); JackLog("JackLibClient::Open name = %s refnum = %ld\n", name, fClientControl->fRefNum);
return 0; return 0;


+ 0
- 1
windows/JackWinNamedPipeServerChannel.cpp View File

@@ -161,7 +161,6 @@ int JackClientPipeThread::HandleRequest()
JackResult res; JackResult res;
if (req.Read(fPipe) == 0) if (req.Read(fPipe) == 0)
res.fResult = fServer->GetEngine()->PortUnRegister(req.fRefNum, req.fPortIndex); res.fResult = fServer->GetEngine()->PortUnRegister(req.fRefNum, req.fPortIndex);
res.Write(fPipe); res.Write(fPipe);
break; break;
} }


Loading…
Cancel
Save