Browse Source

Correct JackMessageBuffer::SetInitCallback.

tags/1.9.9.5
Stephane Letz 13 years ago
parent
commit
4a289f48d9
2 changed files with 5 additions and 5 deletions
  1. +4
    -4
      common/JackMessageBuffer.cpp
  2. +1
    -1
      tests/test.cpp

+ 4
- 4
common/JackMessageBuffer.cpp View File

@@ -111,7 +111,7 @@ bool JackMessageBuffer::Execute()
/* and we're done */ /* and we're done */
fGuard.Signal(); fGuard.Signal();
} }
/* releasing the mutex reduces contention */ /* releasing the mutex reduces contention */
fGuard.Unlock(); fGuard.Unlock();
Flush(); Flush();
@@ -177,17 +177,17 @@ int JackMessageBuffer::SetInitCallback(JackThreadInitCallback callback, void *ar
fGuard.Signal() fGuard.Signal()
// wait for it to be done // wait for it to be done
fGuard.Wait(); fGuard.Wait();
// and we're done
fGuard.Unlock();
*/ */


fGuard.Unlock();
int count = 0; int count = 0;
while (fInit && ++count < 1000) { while (fInit && ++count < 1000) {
/* wake msg buffer thread */ /* wake msg buffer thread */
fGuard.Signal(); fGuard.Signal();
JackSleep(1000); JackSleep(1000);
} }
/* and we're done */
fGuard.Unlock();
if (count == 1000) goto error; if (count == 1000) goto error;
return 0; return 0;
} }


+ 1
- 1
tests/test.cpp View File

@@ -163,7 +163,7 @@ void Collect(FrameTimeCollector* TheFrame)


void Jack_Thread_Init_Callback(void *arg) void Jack_Thread_Init_Callback(void *arg)
{ {
Log("Init callback has been successfully called. (msg from callback)\n");
Log("Init callback has been successfully called from thread = %x. (msg from callback)\n", pthread_self());
init_clbk = 1; init_clbk = 1;
} }




Loading…
Cancel
Save