mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 02:20:11 +01:00
util/queue: handle thread cration failure in util_queue_adjust_num_threads
If a thread cannot be created, make sure the num_threads field is updated to reflect the actual number of threads. Signed-off-by: Greg Depoire--Ferrer <greg.depoire@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15071>
This commit is contained in:
parent
d3bef6ba73
commit
969dfabc77
1 changed files with 3 additions and 1 deletions
|
|
@ -392,8 +392,10 @@ util_queue_adjust_num_threads(struct util_queue *queue, unsigned num_threads)
|
||||||
*/
|
*/
|
||||||
queue->num_threads = num_threads;
|
queue->num_threads = num_threads;
|
||||||
for (unsigned i = old_num_threads; i < num_threads; i++) {
|
for (unsigned i = old_num_threads; i < num_threads; i++) {
|
||||||
if (!util_queue_create_thread(queue, i))
|
if (!util_queue_create_thread(queue, i)) {
|
||||||
|
queue->num_threads = i;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
simple_mtx_unlock(&queue->finish_lock);
|
simple_mtx_unlock(&queue->finish_lock);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue