gallium/u_queue: set num_threads correctly if not all threads start
authorGrazvydas Ignotas <notasas@gmail.com>
Sun, 26 Feb 2017 00:44:07 +0000 (02:44 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 27 Feb 2017 13:49:46 +0000 (14:49 +0100)
If i-th thread could not be created it means we have i threads,
not i+1, because we start from 0.

Fixes: 404d0d5 "gallium/u_queue: add an option to have multiple worker threads"
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/util/u_queue.c

index c51b621..8dd4cb3 100644 (file)
@@ -236,7 +236,7 @@ util_queue_init(struct util_queue *queue,
             goto fail;
          } else {
             /* at least one thread created, so use it */
-            queue->num_threads = i+1;
+            queue->num_threads = i;
             break;
          }
       }