Browse Source

Correct JackWinEnvent::Allocate (handle the ERROR_ALREADY_EXISTS case). Correct JackEngine::ClientExternalNew.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1312 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.60
sletz 18 years ago
parent
commit
71725a26b8
3 changed files with 22 additions and 10 deletions
  1. +5
    -0
      ChangeLog
  2. +11
    -8
      common/JackEngine.cpp
  3. +6
    -2
      windows/JackWinEvent.cpp

+ 5
- 0
ChangeLog View File

@@ -2,6 +2,11 @@
Jackdmp changes log
---------------------------
2006-11-29 Stephane Letz <letz@grame.fr>
* Correct JackWinEnvent::Allocate (handle the ERROR_ALREADY_EXISTS case). Correct JackEngine::ClientExternalNew.
2006-11-22 Stephane Letz <letz@grame.fr>
* In synchronous mode, if the driver time out is reached, the server may get desynchronized (pending signal may arrive in later cycles),


+ 11
- 8
common/JackEngine.cpp View File

@@ -354,24 +354,24 @@ int JackEngine::ClientExternalNew(const char* name, int* ref, int* shared_engine
}

if (!fSynchroTable[refnum]->Allocate(name, 0)) {
jack_error("Cannot allocate synchro");
goto error;
jack_error("Cannot allocate synchro");
goto error1;
}

if (client->Open(name, refnum, shared_client) < 0) {
jack_error("Cannot open client");
goto error;
goto error1;
}

if (!fSignal->TimedWait(5 * 1000000)) {
// Failure if RT thread is not running (problem with the driver...)
jack_error("Driver is not running");
goto error;
goto error2;
}

if (NotifyAddClient(client, name, refnum) < 0) {
jack_error("Cannot notify add client");
goto error;
goto error2;
}

fClientTable[refnum] = client;
@@ -379,10 +379,13 @@ int JackEngine::ClientExternalNew(const char* name, int* ref, int* shared_engine
*shared_engine = fEngineControl->GetShmIndex();
*shared_graph_manager = fGraphManager->GetShmIndex();
*ref = refnum;
return 0;
return 0;
error1:
fGraphManager->ReleaseRefNum(refnum);
return -1;

error:
fGraphManager->ReleaseRefNum(refnum);
error2:
ClientCloseAux(refnum, client, false);
client->Close();
return -1;


+ 6
- 2
windows/JackWinEvent.cpp View File

@@ -134,8 +134,12 @@ bool JackWinEvent::Allocate(const char* name, int value)
if ((fEvent = CreateEvent(NULL, FALSE, FALSE, fName)) == NULL) {
jack_error("Allocate: can't check in named event name = %s err = %ld", fName, GetLastError());
return false;
} else {
return true;
} else if (GetLastError() == ERROR_ALREADY_EXISTS) {
jack_error("Allocate: named event already exist name = %s", fName);
CloseHandle(fEvent);
return false;
} else {
return true;
}
}



Loading…
Cancel
Save