st/nine: clean up thead shutdown sequence a bit
authorAndre Heider <a.heider@gmail.com>
Tue, 6 Nov 2018 08:27:14 +0000 (09:27 +0100)
committerAxel Davy <davyaxel0@gmail.com>
Fri, 9 Nov 2018 21:37:27 +0000 (22:37 +0100)
Just break out of the loop instead, it does the same thing.

Signed-off-by: Andre Heider <a.heider@gmail.com>
Reviewed-by: Axel Davy <davyaxel0@gmail.com>
src/gallium/state_trackers/nine/threadpool.c

index 19721aab2dd1e4c318c8b8c6d6c56397e52253ae..3ce6cd57524f7aaae80b6c5d4e41aedd0980979c 100644 (file)
@@ -52,10 +52,8 @@ threadpool_worker(void *data)
         while (!pool->workqueue && !pool->shutdown)
             pthread_cond_wait(&pool->new_work, &pool->m);
 
-        if (pool->shutdown) {
-            pthread_mutex_unlock(&pool->m);
-            return NULL;
-        }
+        if (pool->shutdown)
+            break;
 
         /* Pull the first task from the list.  We don't free it -- it now lacks
          * a reference other than the worker creator's, whose responsibility it