Browse Source

WIN32 specific code in JackMessageBuffer::SetInitCallback.

tags/1.9.9.5
Stephane Letz 13 years ago
parent
commit
d0747df0ff
1 changed files with 9 additions and 6 deletions
  1. +9
    -6
      common/JackMessageBuffer.cpp

+ 9
- 6
common/JackMessageBuffer.cpp View File

@@ -169,18 +169,19 @@ int JackMessageBuffer::SetInitCallback(JackThreadInitCallback callback, void *ar
fInitArg = arg;
fInit = callback;
/*
The condition variable emulation code does not work reliably on Windows (lost signal).
So use a "hackish" way to signal/wait for the result.
Probaly better in the long term : use pthread-win32 (http://sourceware.org/pthreads-win32/)
#ifndef WIN32
// wake msg buffer thread
fGuard.Signal()
fGuard.Signal();
// wait for it to be done
fGuard.Wait();
// and we're done
fGuard.Unlock();
#else
/*
The condition variable emulation code does not work reliably on Windows (lost signal).
So use a "hackish" way to signal/wait for the result.
Probaly better in the long term : use pthread-win32 (http://sourceware.org/pthreads-win32/`
*/

fGuard.Unlock();
int count = 0;
while (fInit && ++count < 1000) {
@@ -189,6 +190,8 @@ int JackMessageBuffer::SetInitCallback(JackThreadInitCallback callback, void *ar
JackSleep(1000);
}
if (count == 1000) goto error;
#endif
return 0;
}


Loading…
Cancel
Save