|
|
@@ -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; |
|
|
|
} |
|
|
|
|
|
|
|