Browse Source

Simplify request server close only if server is running implementation.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2765 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.90
sletz 17 years ago
parent
commit
a7001745bd
4 changed files with 9 additions and 6 deletions
  1. +7
    -4
      common/JackClient.cpp
  2. +2
    -0
      common/JackClientControl.h
  3. +0
    -1
      common/JackInternalClient.cpp
  4. +0
    -1
      common/JackLibClient.cpp

+ 7
- 4
common/JackClient.cpp View File

@@ -75,7 +75,6 @@ JackClient::JackClient(JackSynchro* table):fThread(this)
fSyncArg = NULL;
fTimebaseArg = NULL;
fThreadFunArg = NULL;
fServerRunning = false;
}

JackClient::~JackClient()
@@ -85,15 +84,17 @@ int JackClient::Close()
{
jack_log("JackClient::Close ref = %ld", GetClientControl()->fRefNum);
int result = 0;
Deactivate();
fChannel->Stop(); // Channels is stopped first to avoid receiving notifications while closing
// Request close only is server is still running
if (fServerRunning) {
if (GetClientControl()->fServer) {
fChannel->ClientClose(GetClientControl()->fRefNum, &result);
} else {
jack_log("JackClient::Close server is shutdown");
}
fChannel->Close();
fSynchroTable[GetClientControl()->fRefNum].Disconnect();
return result;
@@ -581,9 +582,11 @@ ShutDown is called:
void JackClient::ShutDown()
{
jack_log("ShutDown");
fServerRunning = false;
GetClientControl()->fServer = false;
GetClientControl()->fActive = false;
if (fShutdown) {
GetClientControl()->fActive = false;
fShutdown(fShutdownArg);
fShutdown = NULL;
}


+ 2
- 0
common/JackClientControl.h View File

@@ -43,6 +43,7 @@ struct JackClientControl : public JackShmMemAble
int fRefNum;
int fPID;
bool fActive;
bool fServer;

JackClientControl(const char* name, int pid, int refnum)
{
@@ -77,6 +78,7 @@ struct JackClientControl : public JackShmMemAble
fTransportSync = false;
fTransportTimebase = false;
fActive = false;
fServer = true;
}

};


+ 0
- 1
common/JackInternalClient.cpp View File

@@ -147,7 +147,6 @@ int JackInternalClient::Open(const char* server_name, const char* name, jack_opt
}

SetupDriverSync(false);
fServerRunning = true;
return 0;

error:


+ 0
- 1
common/JackLibClient.cpp View File

@@ -118,7 +118,6 @@ int JackLibClient::Open(const char* server_name, const char* name, jack_options_
}
jack_log("JackLibClient::Open name = %s refnum = %ld", name_res, GetClientControl()->fRefNum);
fServerRunning = true;
return 0;

error:


Loading…
Cancel
Save