Commit f5fd13a2 authored by sletz's avatar sletz
Browse files

Naming of synchro primitive on Windows.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4741 0c269be4-1314-0410-8aa9-9f06e86f4224
parent a38847e6
......@@ -87,7 +87,7 @@ class SERVER_EXPORT JackClient : public JackClientInterface, public JackRunnable
void* fThreadFunArg;
void* fSessionArg;
void* fLatencyArg;
char fServerName[64];
char fServerName[JACK_SERVER_CONTROL_NAME_SIZE];
JackThread fThread; /*! Thread to execute the Process function */
detail::JackClientChannelInterface* fChannel;
......
......@@ -38,13 +38,16 @@ namespace Jack
JackEngine::JackEngine(JackGraphManager* manager,
JackSynchro* table,
JackEngineControl* control)
JackEngineControl* control)
: fSignal(control->fServerName)
{
fGraphManager = manager;
fSynchroTable = table;
fEngineControl = control;
for (int i = 0; i < CLIENT_NUM; i++)
for (int i = 0; i < CLIENT_NUM; i++) {
fClientTable[i] = NULL;
}
fLastSwitchUsecs = 0;
fMaxUUID = 0;
fSessionPendingReplies = 0;
......@@ -132,8 +135,9 @@ void JackEngine::ReleaseRefnum(int ref)
if (fEngineControl->fTemporary) {
int i;
for (i = fEngineControl->fDriverNum; i < CLIENT_NUM; i++) {
if (fClientTable[i])
if (fClientTable[i]) {
break;
}
}
if (i == CLIENT_NUM) {
// last client and temporay case: quit the server
......
......@@ -29,7 +29,14 @@ namespace Jack
JackMessageBuffer* JackMessageBuffer::fInstance = NULL;
JackMessageBuffer::JackMessageBuffer()
:fInit(NULL),fInitArg(NULL),fThread(this),fInBuffer(0),fOutBuffer(0),fOverruns(0),fRunning(false)
:fInit(NULL),
fInitArg(NULL),
fThread(this),
fGuard("JackMessageBuffer"),
fInBuffer(0),
fOutBuffer(0),
fOverruns(0),
fRunning(false)
{}
JackMessageBuffer::~JackMessageBuffer()
......
......@@ -3309,8 +3309,8 @@
4B1499EE14BDA5B300A51A3C /* JackGenericClientChannel.cpp */,
4B1499EF14BDA5B300A51A3C /* JackGenericClientChannel.h */,
4BF8D1AF0834EEC400C94B91 /* JackChannel.h */,
4BB371D40C1AD85A0050C1E4 /* JackNotification.h */,
4BF8D1B30834EED500C94B91 /* JackInternalClientChannel.h */,
4BB371D40C1AD85A0050C1E4 /* JackNotification.h */,
4BFB299908AF452300D450D4 /* Socket */,
);
name = Channels;
......
......@@ -41,7 +41,7 @@ class JackPosixProcessSync : public JackBasePosixMutex
public:
JackPosixProcessSync():JackBasePosixMutex()
JackPosixProcessSync(const char* name = NULL):JackBasePosixMutex()
{
int res = pthread_cond_init(&fCond, NULL);
ThrowIf(res != 0, JackException("JackBasePosixMutex: could not init the cond variable"));
......
......@@ -44,7 +44,7 @@ class SERVER_EXPORT JackBaseWinMutex
JackBaseWinMutex():fOwner(0)
{
// In recursive mode by default
fMutex = (HANDLE)CreateMutex(0, FALSE, 0);
fMutex = CreateMutex(NULL, FALSE, NULL);
ThrowIf(fMutex == 0, JackException("JackWinMutex: could not init the mutex"));
}
......@@ -71,7 +71,7 @@ class SERVER_EXPORT JackWinMutex
JackWinMutex()
{
// In recursive mode by default
fMutex = (HANDLE)CreateMutex(0, FALSE, 0);
fMutex = CreateMutex(NULL, FALSE, NULL);
}
virtual ~JackWinMutex()
......
......@@ -39,12 +39,12 @@ class JackWinProcessSync : public JackWinMutex
public:
JackWinProcessSync():JackWinMutex()
JackWinProcessSync(const char* name = NULL):JackWinMutex()
{
//fEvent = (HANDLE)CreateEvent(NULL, FALSE, FALSE, NULL);
fEvent = (HANDLE)CreateEvent(NULL, TRUE, FALSE, NULL); // Needs ResetEvent
//fEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
fEvent = CreateEvent(NULL, TRUE, FALSE, (LPCTSTR)name); // Needs ResetEvent
}
~JackWinProcessSync()
virtual ~JackWinProcessSync()
{
CloseHandle(fEvent);
}
......
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