Allow thread reinitialization.

This commit is contained in:
Brandon Wright 2018-04-13 09:25:18 -05:00
parent 2426c2412f
commit 8b99749aba
1 changed files with 2 additions and 0 deletions

View File

@ -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);
}