From ac52faa6c2eab8a16408dbb670f77d464e61c040 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 16 Feb 2016 09:04:21 -0500 Subject: [PATCH] Fix failure to restart after calling LiStopConnection --- limelight-common/Platform.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/limelight-common/Platform.c b/limelight-common/Platform.c index a6fe891..1ede538 100644 --- a/limelight-common/Platform.c +++ b/limelight-common/Platform.c @@ -127,7 +127,7 @@ void PltUnlockMutex(PLT_MUTEX* mutex) { } void PltJoinThread(PLT_THREAD* thread) { - LC_ASSERT(thread->cancelled != 0); + LC_ASSERT(thread->cancelled); #if defined(LC_WINDOWS) WaitForSingleObjectEx(thread->handle, INFINITE, FALSE); #else @@ -194,6 +194,8 @@ int PltCreateThread(ThreadEntry entry, void* context, PLT_THREAD* thread) { ctx->entry = entry; ctx->context = context; ctx->thread = thread; + + thread->cancelled = 0; #if defined(LC_WINDOWS) { @@ -203,8 +205,6 @@ int PltCreateThread(ThreadEntry entry, void* context, PLT_THREAD* thread) { return -1; } - thread->cancelled = 0; - thread->handle = CreateThread(NULL, 0, ThreadProc, ctx, 0, &thread->tid); if (thread->handle == NULL) { CloseHandle(thread->termRequested);