diff options
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/util/u_queue.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_queue.c b/src/gallium/auxiliary/util/u_queue.c index 643c92b28b6..55ac402fb33 100644 --- a/src/gallium/auxiliary/util/u_queue.c +++ b/src/gallium/auxiliary/util/u_queue.c @@ -294,9 +294,18 @@ util_queue_add_job(struct util_queue *queue, struct util_queue_job *ptr; assert(fence->signalled); - fence->signalled = false; pipe_mutex_lock(queue->lock); + if (queue->kill_threads) { + pipe_mutex_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 */ |