From c044ac8da18d81b8d6cc2d863381249f215ee448 Mon Sep 17 00:00:00 2001 From: Stephane Letz Date: Fri, 16 Mar 2012 17:37:17 +0100 Subject: [PATCH] Some documentation in JackMessageBuffer::SetInitCallback. --- common/JackMessageBuffer.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/JackMessageBuffer.cpp b/common/JackMessageBuffer.cpp index ca013df3..17bd6fa4 100644 --- a/common/JackMessageBuffer.cpp +++ b/common/JackMessageBuffer.cpp @@ -169,14 +169,20 @@ 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 "hachish" way to signal/wait for the result. + Probaly better in the long term : use pthread-win32 (http://sourceware.org/pthreads-win32/) + fGuard.Wait(); + */ + int count = 0; while (fInit && ++count < 1000) { /* wake msg buffer thread */ fGuard.Signal(); JackSleep(1000); } - //fGuard.Wait(); - + /* and we're done */ fGuard.Unlock(); if (count == 1000) goto error;