Commit 1864b361 authored by sletz's avatar sletz
Browse files

Correct server temporary mode : now set a global and quit after server/client...

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
parent 36540b7e
......@@ -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>
......
......@@ -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;
}
}
}
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment