diff options
-rw-r--r-- | src/util/u_queue.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/util/u_queue.c b/src/util/u_queue.c index 05196674189..8db09b027c2 100644 --- a/src/util/u_queue.c +++ b/src/util/u_queue.c @@ -298,9 +298,18 @@ util_queue_add_job(struct util_queue *queue, struct util_queue_job *ptr; assert(fence->signalled); - fence->signalled = false; mtx_lock(&queue->lock); + if (queue->kill_threads) { + mtx_unlock(&queue->lock); + /* well no good option here, but any leaks will be + * short-lived as things are shutting down.. + */ + return; + } + + fence->signalled = false; + assert(queue->num_queued >= 0 && queue->num_queued <= queue->max_jobs); /* if the queue is full, wait until there is space */ |