Browse Source

Correct server temporary mode : now set a global and quit after server/client message handling is finished.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3650 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/v1.9.4
sletz 16 years ago
parent
commit
1864b36159
8 changed files with 28 additions and 5 deletions
  1. +5
    -1
      ChangeLog
  2. +1
    -3
      common/JackEngine.cpp
  3. +1
    -1
      common/JackGlobals.h
  4. +1
    -0
      common/JackServerGlobals.cpp
  5. +1
    -0
      common/JackServerGlobals.h
  6. +5
    -0
      macosx/JackMachServerChannel.cpp
  7. +7
    -0
      posix/JackSocketServerChannel.cpp
  8. +7
    -0
      windows/JackWinNamedPipeServerChannel.cpp

+ 5
- 1
ChangeLog View File

@@ -23,7 +23,11 @@ Paul Davis
---------------------------
Jackdmp changes log
---------------------------
---------------------------
2009-10-17 Stephane Letz <letz@grame.fr>
* Correct server temporary mode : now set a global and quit after server/client message handling is finished.

2009-10-15 Stephane Letz <letz@grame.fr>


+ 1
- 3
common/JackEngine.cpp View File

@@ -119,9 +119,7 @@ void JackEngine::ReleaseRefnum(int ref)
// last client and temporay case: quit the server
jack_log("JackEngine::ReleaseRefnum server quit");
fEngineControl->fTemporary = false;
#ifndef WIN32
exit(0);
#endif
JackServerGlobals::fKilled = true;
}
}
}


+ 1
- 1
common/JackGlobals.h View File

@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace Jack
{

// Globals used for client management on server or libray side.
// Globals used for client management on server or library side.
struct JackGlobals {

static jack_tls_key fRealTime;


+ 1
- 0
common/JackServerGlobals.cpp View File

@@ -28,6 +28,7 @@ static char* server_name = NULL;
namespace Jack
{

bool JackServerGlobals::fKilled = false;
JackServer* JackServerGlobals::fInstance;
unsigned int JackServerGlobals::fUserCount;
bool (* JackServerGlobals::on_device_acquire)(const char * device_name) = NULL;


+ 1
- 0
common/JackServerGlobals.h View File

@@ -36,6 +36,7 @@ class JackClient;

struct SERVER_EXPORT JackServerGlobals
{
static bool fKilled;
static JackServer* fInstance;
static unsigned int fUserCount;
static bool (* on_device_acquire)(const char * device_name);


+ 5
- 0
macosx/JackMachServerChannel.cpp View File

@@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "JackServer.h"
#include "JackLockedEngine.h"
#include "JackNotification.h"
#include "JackServerGlobals.h"

using namespace std;

@@ -137,6 +138,10 @@ boolean_t JackMachServerChannel::MessageHandler(mach_msg_header_t* Request, mach
channel->ClientKill(Request->msgh_local_port);
} else {
JackRPCEngine_server(Request, Reply);
// Issued by JackEngine::ReleaseRefnum when temporary mode is used
if (JackServerGlobals::fKilled) {
kill(JackTools::GetPID(), SIGINT);
}
}
return true;
}


+ 7
- 0
posix/JackSocketServerChannel.cpp View File

@@ -395,6 +395,13 @@ bool JackSocketServerChannel::HandleRequest(int fd)
jack_error("Unknown request %ld", header.fType);
break;
}
/* TODO
// Issued by JackEngine::ReleaseRefnum when temporary mode is used
if (JackServerGlobals::fKilled) {
kill(JackTools::GetPID(), SIGINT);
}
*/

return true;
}


+ 7
- 0
windows/JackWinNamedPipeServerChannel.cpp View File

@@ -316,6 +316,13 @@ bool JackClientPipeThread::HandleRequest()
break;
}
}
/* TODO
// Issued by JackEngine::ReleaseRefnum when temporary mode is used
if (JackServerGlobals::fKilled) {
kill(JackTools::GetPID(), SIGINT);
}
*/

// Unlock the global mutex
ReleaseMutex(fMutex);


Loading…
Cancel
Save