Make fInit volatile in JackMessageBuffer class.

This commit is contained in:
Stephane Letz 2012-03-16 22:31:38 +01:00
parent c044ac8da1
commit d7fceb12fb
2 changed files with 5 additions and 2 deletions

View File

@ -171,8 +171,11 @@ int JackMessageBuffer::SetInitCallback(JackThreadInitCallback callback, void *ar
/*
The condition variable emulation code does not work reliably on Windows (lost signal).
So use a "hachish" way to signal/wait for the result.
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/)
// wake msg buffer thread
fGuard.Signal()
// wait for it to be done
fGuard.Wait();
*/

View File

@ -57,7 +57,7 @@ class JackMessageBuffer : public JackRunnableInterface
private:
JackThreadInitCallback fInit;
volatile JackThreadInitCallback fInit;
void* fInitArg;
JackMessage fBuffers[MB_BUFFERS];
JackThread fThread;