From 315c3fd67ddabd747528bb200e6c690bec5d603c Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 23 Jan 2020 03:03:44 +0000 Subject: [PATCH] Move the taskqueue_state.numthreads update so that the creation loop works again. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12512 d7cf8633-e32d-0410-b094-e92efae38249 --- taskqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taskqueue.c b/taskqueue.c index c30096c1..710a40e2 100644 --- a/taskqueue.c +++ b/taskqueue.c @@ -171,9 +171,9 @@ void TaskQueue_Frame(qboolean shutdown) Thread_AtomicLock(&taskqueue_state.command_lock); taskqueue_state.threads_quit = 0; Thread_AtomicUnlock(&taskqueue_state.command_lock); - taskqueue_state.numthreads = numthreads; for (i = taskqueue_state.numthreads; i < numthreads; i++) taskqueue_state.threads[i].handle = Thread_CreateThread(TaskQueue_ThreadFunc, &taskqueue_state.threads[i]); + taskqueue_state.numthreads = numthreads; // if there are still pending tasks (e.g. no threads), execute them on main thread now TaskQueue_Execute(true); } -- 2.39.2