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) {
|
||||
LC_ASSERT(thread->cancelled != 0);
|
||||
LC_ASSERT(thread->cancelled);
|
||||
#if defined(LC_WINDOWS)
|
||||
WaitForSingleObjectEx(thread->handle, INFINITE, FALSE);
|
||||
#else
|
||||
@ -195,6 +195,8 @@ int PltCreateThread(ThreadEntry entry, void* context, PLT_THREAD* thread) {
|
||||
ctx->context = context;
|
||||
ctx->thread = thread;
|
||||
|
||||
thread->cancelled = 0;
|
||||
|
||||
#if defined(LC_WINDOWS)
|
||||
{
|
||||
thread->termRequested = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
|
||||
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user