mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 09:25:49 +00:00
Fix failure to restart after calling LiStopConnection
This commit is contained in:
parent
9e592ad3c6
commit
ac52faa6c2
@ -127,7 +127,7 @@ void PltUnlockMutex(PLT_MUTEX* mutex) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PltJoinThread(PLT_THREAD* thread) {
|
void PltJoinThread(PLT_THREAD* thread) {
|
||||||
LC_ASSERT(thread->cancelled != 0);
|
LC_ASSERT(thread->cancelled);
|
||||||
#if defined(LC_WINDOWS)
|
#if defined(LC_WINDOWS)
|
||||||
WaitForSingleObjectEx(thread->handle, INFINITE, FALSE);
|
WaitForSingleObjectEx(thread->handle, INFINITE, FALSE);
|
||||||
#else
|
#else
|
||||||
@ -194,6 +194,8 @@ int PltCreateThread(ThreadEntry entry, void* context, PLT_THREAD* thread) {
|
|||||||
ctx->entry = entry;
|
ctx->entry = entry;
|
||||||
ctx->context = context;
|
ctx->context = context;
|
||||||
ctx->thread = thread;
|
ctx->thread = thread;
|
||||||
|
|
||||||
|
thread->cancelled = 0;
|
||||||
|
|
||||||
#if defined(LC_WINDOWS)
|
#if defined(LC_WINDOWS)
|
||||||
{
|
{
|
||||||
@ -203,8 +205,6 @@ int PltCreateThread(ThreadEntry entry, void* context, PLT_THREAD* thread) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
thread->cancelled = 0;
|
|
||||||
|
|
||||||
thread->handle = CreateThread(NULL, 0, ThreadProc, ctx, 0, &thread->tid);
|
thread->handle = CreateThread(NULL, 0, ThreadProc, ctx, 0, &thread->tid);
|
||||||
if (thread->handle == NULL) {
|
if (thread->handle == NULL) {
|
||||||
CloseHandle(thread->termRequested);
|
CloseHandle(thread->termRequested);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user