From: havoc Date: Thu, 23 Jan 2020 03:03:44 +0000 (+0000) Subject: Move the taskqueue_state.numthreads update so that the creation loop works again. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=315c3fd67ddabd747528bb200e6c690bec5d603c;p=xonotic%2Fdarkplaces.git 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 --- 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); }