Thread_AtomicLock(&taskqueue_state.command_lock);\r
taskqueue_state.threads_quit = 0;\r
Thread_AtomicUnlock(&taskqueue_state.command_lock);\r
- taskqueue_state.numthreads = numthreads;\r
for (i = taskqueue_state.numthreads; i < numthreads; i++)\r
taskqueue_state.threads[i].handle = Thread_CreateThread(TaskQueue_ThreadFunc, &taskqueue_state.threads[i]);\r
+ taskqueue_state.numthreads = numthreads;\r
// if there are still pending tasks (e.g. no threads), execute them on main thread now\r
TaskQueue_Execute(true);\r
}\r