Commit d37f95f3 authored by sletz's avatar sletz
Browse files

Add a test for coherent freewheel state in JackDebugClient. Cleanup JackMutex class.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2416 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 93f1b9a9
......@@ -23,6 +23,8 @@ Fernando Lopez-Lezcano
2008-06-02 Stephane Letz <letz@grame.fr>
* Cleanup and correct wscript for example-clients.
* Add a test for coherent freewheel state in JackDebugClient.
* Cleanup JackMutex class.
2008-05-31 Stephane Letz <letz@grame.fr>
......
......@@ -41,6 +41,7 @@ JackDebugClient::JackDebugClient(JackClient * client)
fIsDeactivated = 0;
fIsClosed = 0;
fClient = client;
fFreewheel = false;
}
JackDebugClient::~JackDebugClient()
......@@ -321,6 +322,11 @@ int JackDebugClient::SetBufferSize(jack_nframes_t buffer_size)
int JackDebugClient::SetFreeWheel(int onoff)
{
CheckClient();
if (onoff && fFreewheel)
*fStream << "!!! ERROR !!! : Freewheel setup seems incorrect : set = ON while FW is already ON " << endl;
if (!onoff && !fFreewheel)
*fStream << "!!! ERROR !!! : Freewheel setup seems incorrect : set = OFF while FW is already OFF " << endl;
fFreewheel = onoff;
return fClient->SetFreeWheel(onoff);
}
......
......@@ -58,6 +58,7 @@ class JackDebugClient : public JackClient
int fIsActivated;
int fIsDeactivated;
int fIsClosed;
bool fFreewheel;
char fClientName[JACK_CLIENT_NAME_SIZE + 1];
JackProcessCallback fProcessTimeCallback;
void* fProcessTimeCallbackArg;
......
......@@ -54,7 +54,7 @@ class JackMutex
// In recursive mode by default
fMutex = CreateMutex(0, FALSE, 0);
}
virtual ~JackMutex()
~JackMutex()
{
CloseHandle(fMutex);
}
......@@ -90,7 +90,7 @@ class JackMutex
res = pthread_mutexattr_destroy(&mutex_attr);
assert(res == 0);
}
virtual ~JackMutex()
~JackMutex()
{
pthread_mutex_destroy(&fMutex);
}
......@@ -124,13 +124,15 @@ class JackLockAble
JackMutex fMutex;
public:
protected:
JackLockAble()
{}
virtual ~JackLockAble()
~JackLockAble()
{}
public:
void Lock()
{
fMutex.Lock();
......@@ -166,7 +168,7 @@ class JackLock
fObj->Lock();
}
virtual ~JackLock()
~JackLock()
{
fObj->Unlock();
}
......
......@@ -224,7 +224,7 @@ no graph state change can be done during freewheel mode.
int JackServer::SetFreewheel(bool onoff)
{
jack_log("JackServer::SetFreewheel state = %ld", onoff);
jack_log("JackServer::SetFreewheel is = %ld want = %ld", fFreewheel, onoff);
if (fFreewheel) {
if (onoff) {
......
......@@ -1139,6 +1139,7 @@
4BC2168D0A444BED00BDA09F /* JackServerGlobals.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JackServerGlobals.h; path = ../common/JackServerGlobals.h; sourceTree = SOURCE_ROOT; };
4BC3988908B3CF6C00B6F371 /* JackDummyDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = JackDummyDriver.cpp; path = ../common/JackDummyDriver.cpp; sourceTree = SOURCE_ROOT; };
4BC3988A08B3CF6C00B6F371 /* JackDummyDriver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JackDummyDriver.h; path = ../common/JackDummyDriver.h; sourceTree = SOURCE_ROOT; };
4BC8326D0DF42C7D00DD1C93 /* JackMutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JackMutex.h; path = ../common/JackMutex.h; sourceTree = SOURCE_ROOT; };
4BCC87950D57168300A7FEB1 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = /System/Library/Frameworks/Accelerate.framework; sourceTree = "<absolute>"; };
4BD4B4D409BACD9600750C0F /* JackTransportEngine.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JackTransportEngine.h; path = ../common/JackTransportEngine.h; sourceTree = SOURCE_ROOT; };
4BD4B4D509BACD9600750C0F /* JackTransportEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = JackTransportEngine.cpp; path = ../common/JackTransportEngine.cpp; sourceTree = SOURCE_ROOT; };
......@@ -1968,6 +1969,7 @@
4BA3874007947A46008D8992 /* Synchro */ = {
isa = PBXGroup;
children = (
4BC8326D0DF42C7D00DD1C93 /* JackMutex.h */,
4B02069D0DC0BAB400319AF1 /* JackProcessSync.cpp */,
4BF8D1A70834EEB400C94B91 /* JackActivationCount.h */,
4BF8D1A80834EEB400C94B91 /* JackActivationCount.cpp */,
......
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