Commit c29ab689 authored by sletz's avatar sletz
Browse files

Libjack shutdown handler does not deactivate (fActive = false) the client...

Libjack shutdown handler does not deactivate (fActive = false) the client anymore, so that jack_deactivate correctly does the job later on.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3088 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 44e49389
......@@ -23,6 +23,10 @@ Michael Voigt
Jackdmp changes log
---------------------------
2008-11-19 Stephane Letz <letz@grame.fr>
* Libjack shutdown handler does not "deactivate" (fActive = false) the client anymore, so that jack_deactivate correctly does the job later on.
2008-11-14 Stephane Letz <letz@grame.fr>
* Version 1.9.1 started, fix symbols export in ringbuffer.c, cleanup on Windows.
......
......@@ -407,17 +407,17 @@ jack_nframes_t JackClient::Wait(int status)
CallTimebaseCallback();
SignalSync();
if (status != 0)
return End();
End(); // Terminates the thread
if (!WaitSync())
return Error();
Error(); // Terminates the thread
CallSyncCallback();
return GetEngineControl()->fBufferSize;
}
jack_nframes_t JackClient::CycleWait()
{
if (!WaitSync())
return Error();
if (!WaitSync())
Error(); // Terminates the thread
CallSyncCallback();
return GetEngineControl()->fBufferSize;
}
......@@ -427,8 +427,8 @@ void JackClient::CycleSignal(int status)
if (status == 0)
CallTimebaseCallback();
SignalSync();
if (status != 0)
End();
if (status != 0)
End(); // Terminates the thread
}
inline int JackClient::CallProcessCallback()
......@@ -455,7 +455,7 @@ inline void JackClient::SignalSync()
}
}
inline int JackClient::End()
inline void JackClient::End()
{
jack_log("JackClient::Execute end name = %s", GetClientControl()->fName);
// Hum... not sure about this, the following "close" code is called in the RT thread...
......@@ -463,10 +463,10 @@ inline int JackClient::End()
fThread.DropRealTime();
GetClientControl()->fActive = false;
fChannel->ClientDeactivate(GetClientControl()->fRefNum, &result);
return 0;
fThread.Terminate();
}
inline int JackClient::Error()
inline void JackClient::Error()
{
jack_error("JackClient::Execute error name = %s", GetClientControl()->fName);
// Hum... not sure about this, the following "close" code is called in the RT thread...
......@@ -475,7 +475,7 @@ inline int JackClient::Error()
GetClientControl()->fActive = false;
fChannel->ClientDeactivate(GetClientControl()->fRefNum, &result);
ShutDown();
return 0;
fThread.Terminate();
}
//-----------------
......@@ -600,7 +600,6 @@ void JackClient::ShutDown()
// Be sure client is already started
if (GetClientControl()) {
GetClientControl()->fServer = false;
GetClientControl()->fActive = false;
}
if (fShutdown) {
......
......@@ -104,8 +104,8 @@ class JackClient : public JackClientInterface, public JackRunnableInterface
inline bool WaitSync();
inline void SignalSync();
inline int CallProcessCallback();
inline int End();
inline int Error();
inline void End();
inline void Error();
public:
......
......@@ -216,7 +216,12 @@ typedef void (*JackFreewheelCallback)(int starting, void *arg);
/**
* Prototype for the client supplied function that is called
* whenever jackd is shutdown.
* whenever jackd is shutdown. Note that after server shutdown,
* the client pointer is *not* deallocated by libjack,
* the application is responsible to properly use jack_client_close()
* to release client ressources. Warning: jack_client_close() cannot be
* safely used inside the shutdown callback and has to be called outside of
* the callback context.
*
* @param arg pointer to a client supplied structure
*/
......
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