mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
util/u_queue: skip util_queue_finish if num_threads is 0
This fixes a deadlock in pthread_barrier_destroy.
Cc: 19.1 19.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit c2efd2cbfb)
This commit is contained in:
parent
e2b416e8ae
commit
340849f311
1 changed files with 7 additions and 0 deletions
|
|
@ -637,6 +637,13 @@ util_queue_finish(struct util_queue *queue)
|
|||
* wait for it exclusively.
|
||||
*/
|
||||
mtx_lock(&queue->finish_lock);
|
||||
|
||||
/* The number of threads can be changed to 0, e.g. by the atexit handler. */
|
||||
if (!queue->num_threads) {
|
||||
mtx_unlock(&queue->finish_lock);
|
||||
return;
|
||||
}
|
||||
|
||||
fences = malloc(queue->num_threads * sizeof(*fences));
|
||||
util_barrier_init(&barrier, queue->num_threads);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue