|
|
|
@@ -31,9 +31,11 @@ DWORD WINAPI JackWinThread::ThreadHandler(void* arg) |
|
|
|
JackWinThread* obj = (JackWinThread*)arg; |
|
|
|
JackRunnableInterface* runnable = obj->fRunnable; |
|
|
|
|
|
|
|
set_threaded_log_function(); |
|
|
|
|
|
|
|
// Signal creation thread when started with StartSync |
|
|
|
jack_log("ThreadHandler: start"); |
|
|
|
obj->fStatus = kRunning; |
|
|
|
obj->fStatus = kIniting; |
|
|
|
|
|
|
|
// Call Init method |
|
|
|
if (!runnable->Init()) { |
|
|
|
@@ -41,6 +43,8 @@ DWORD WINAPI JackWinThread::ThreadHandler(void* arg) |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
obj->fStatus = kRunning; |
|
|
|
|
|
|
|
// If Init succeed, start the thread loop |
|
|
|
bool res = true; |
|
|
|
while (obj->fStatus == kRunning && res) { |
|
|
|
@@ -87,7 +91,7 @@ int JackWinThread::StartSync() |
|
|
|
return -1; |
|
|
|
} else { |
|
|
|
int count = 0; |
|
|
|
while (fStatus != kRunning && ++count < 1000) { |
|
|
|
while (fStatus == kStarting && ++count < 1000) { |
|
|
|
JackSleep(1000); |
|
|
|
} |
|
|
|
return (count == 1000) ? -1 : 0; |
|
|
|
|