mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-24 01:40:12 -05:00
threads: set thread titles
This commit is contained in:
parent
4801e39eae
commit
bd734d5bed
2 changed files with 15 additions and 0 deletions
8
render.c
8
render.c
|
|
@ -1,9 +1,11 @@
|
|||
#include "render.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/timerfd.h>
|
||||
#include <sys/prctl.h>
|
||||
|
||||
#include <wayland-cursor.h>
|
||||
#include <xdg-shell.h>
|
||||
|
|
@ -316,6 +318,12 @@ render_worker_thread(void *_ctx)
|
|||
struct terminal *term = ctx->term;
|
||||
const int my_id = ctx->my_id;
|
||||
|
||||
char proc_title[16];
|
||||
snprintf(proc_title, sizeof(proc_title), "foot:render:%d", my_id);
|
||||
|
||||
if (prctl(PR_SET_NAME, proc_title, 0, 0, 0) < 0)
|
||||
LOG_ERRNO("render worker %d: failed to set process title", my_id);
|
||||
|
||||
sem_t *start = &term->render.workers.start;
|
||||
sem_t *done = &term->render.workers.done;
|
||||
mtx_t *lock = &term->render.workers.lock;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue