util/u_queue: fix util_queue_finish deadlock by merging lock and finish_lock
and by disabling the on-demand thread creation, which breaks the finish logic.
Fixes: 3713dc6b2a - util/u_queue: add UTIL_QUEUE_INIT_SCALE_THREADS flag
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8363
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24173>
This commit is contained in:
+2
-2
@@ -205,7 +205,6 @@ struct util_queue_job {
|
||||
/* Put this into your context. */
|
||||
struct util_queue {
|
||||
char name[14]; /* 13 characters = the thread name without the index */
|
||||
simple_mtx_t finish_lock; /* for util_queue_finish and protects threads/num_threads */
|
||||
mtx_t lock;
|
||||
cnd_t has_queued_cond;
|
||||
cnd_t has_space_cond;
|
||||
@@ -249,7 +248,8 @@ void util_queue_finish(struct util_queue *queue);
|
||||
* and it can't be less than 1.
|
||||
*/
|
||||
void
|
||||
util_queue_adjust_num_threads(struct util_queue *queue, unsigned num_threads);
|
||||
util_queue_adjust_num_threads(struct util_queue *queue, unsigned num_threads,
|
||||
bool locked);
|
||||
|
||||
int64_t util_queue_get_thread_time_nano(struct util_queue *queue,
|
||||
unsigned thread_index);
|
||||
|
||||
Reference in New Issue
Block a user