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; fSyncArg = NULL;
fTimebaseArg = NULL; fTimebaseArg = NULL;
fThreadFunArg = NULL; fThreadFunArg = NULL;
fServerRunning = false;
} }


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


+ 2
- 0
common/JackClientControl.h View File

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


JackClientControl(const char* name, int pid, int refnum) JackClientControl(const char* name, int pid, int refnum)
{ {
@@ -77,6 +78,7 @@ struct JackClientControl : public JackShmMemAble
fTransportSync = false; fTransportSync = false;
fTransportTimebase = false; fTransportTimebase = false;
fActive = 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); SetupDriverSync(false);
fServerRunning = true;
return 0; return 0;


error: 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); jack_log("JackLibClient::Open name = %s refnum = %ld", name_res, GetClientControl()->fRefNum);
fServerRunning = true;
return 0; return 0;


error: error:


Loading…
Cancel
Save