diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2021-12-21 13:23:52 -0800 |
---|---|---|
committer | Chia-I Wu <olvaffe@gmail.com> | 2022-01-07 14:10:21 -0800 |
commit | 0fc9933dcfa7d587133e9bd8a86f3a3a3bc94b98 (patch) | |
tree | 68a8a5843b97acfa50d6f459c5724fd17afc3840 /server | |
parent | bcd4a601b6d01ca8242ae40881426189591a3e41 (diff) |
server: track workers in render_worker_jail
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Diffstat (limited to 'server')
-rw-r--r-- | server/render_worker.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/render_worker.c b/server/render_worker.c index c59d8da..165cf98 100644 --- a/server/render_worker.c +++ b/server/render_worker.c @@ -35,6 +35,7 @@ struct render_worker_jail { struct minijail *minijail; + struct list_head workers; int worker_count; }; @@ -46,6 +47,8 @@ struct render_worker { #endif bool reaped; + struct list_head head; + char thread_data[]; }; @@ -154,8 +157,9 @@ fork_minijail(const struct minijail *template) static void render_worker_jail_add_worker(struct render_worker_jail *jail, - UNUSED struct render_worker *worker) + struct render_worker *worker) { + list_add(&worker->head, &jail->workers); jail->worker_count++; } @@ -163,6 +167,7 @@ static void render_worker_jail_remove_worker(struct render_worker_jail *jail, struct render_worker *worker) { + list_del(&worker->head); jail->worker_count--; free(worker); @@ -178,6 +183,7 @@ render_worker_jail_create(int max_worker_count, return NULL; jail->max_worker_count = max_worker_count; + list_inithead(&jail->workers); #if defined(ENABLE_RENDER_SERVER_WORKER_MINIJAIL) jail->minijail = create_minijail(seccomp_filter, seccomp_path); |