aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/u_queue.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-08-06 20:32:31 -0400
committerMarek Olšák <[email protected]>2019-04-01 12:37:52 -0400
commitbb111559f2929cf2692ea421ba514fcd075bfe1c (patch)
treea28c1189df87ec1a210c85cf4b2ebd28c299d917 /src/util/u_queue.h
parentd99cdc9d5902da8437eabbd2f6981d01e4f7b78f (diff)
util/queue: add ability to kill a subset of threads
for ARB_parallel_shader_compile
Diffstat (limited to 'src/util/u_queue.h')
-rw-r--r--src/util/u_queue.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/util/u_queue.h b/src/util/u_queue.h
index 4e63a76aab2..756fa53e1bf 100644
--- a/src/util/u_queue.h
+++ b/src/util/u_queue.h
@@ -201,15 +201,14 @@ struct util_queue_job {
/* Put this into your context. */
struct util_queue {
char name[14]; /* 13 characters = the thread name without the index */
- mtx_t finish_lock; /* only for util_queue_finish */
+ 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;
thrd_t *threads;
unsigned flags;
int num_queued;
- unsigned num_threads;
- int kill_threads;
+ unsigned num_threads; /* decreasing this number will terminate threads */
int max_jobs;
int write_idx, read_idx; /* ring buffer pointers */
struct util_queue_job *jobs;