From 8b99749abade13cd3e7c609368ec521f21ed9f45 Mon Sep 17 00:00:00 2001 From: Brandon Wright Date: Fri, 13 Apr 2018 09:25:18 -0500 Subject: [PATCH] Allow thread reinitialization. --- apu/apu.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apu/apu.cpp b/apu/apu.cpp index 46742d89..9ad13b4e 100644 --- a/apu/apu.cpp +++ b/apu/apu.cpp @@ -309,6 +309,7 @@ static void S9xAPUThreadInit(void) thread_running_semaphore = CreateSemaphore(NULL, 0, 1, NULL); thread_waiting_semaphore = CreateSemaphore(NULL, 0, 1, NULL); thread_running = FALSE; + thread_exit = FALSE; worker_thread = CreateThread(NULL, 0,S9xAPUWorkerThread, NULL, 0, &worker_thread_id); } @@ -383,6 +384,7 @@ static void S9xAPUThreadInit(void) pthread_cond_init(&thread_running_cond, NULL); pthread_mutex_init(&thread_running_mutex, NULL); thread_running = FALSE; + thread_exit = FALSE; pthread_create(&worker_thread, NULL, S9xAPUWorkerThread, NULL); }