From: Bernd Schubert Date: Mon, 27 Jan 2025 20:33:43 +0000 (+0100) Subject: lib: Set thread names X-Git-Tag: fuse-3.17.1-rc0~13 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=fa28806932ff118d2da5b874a53cf64a85899300;p=qemu-gpiodev%2Flibfuse.git lib: Set thread names Main worker threads: fuse_worker high level clean up threads: "fuse_prune_nodes" Signed-off-by: Bernd Schubert --- diff --git a/lib/fuse.c b/lib/fuse.c index 8fbc035..5d57d24 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -9,6 +9,8 @@ See the file COPYING.LIB */ +#define _GNU_SOURCE + #include "fuse_config.h" #include "fuse_i.h" #include "fuse_lowlevel.h" @@ -4890,6 +4892,8 @@ static void *fuse_prune_nodes(void *fuse) struct fuse *f = fuse; int sleep_time; + pthread_setname_np(pthread_self(), "fuse_prune_nodes"); + while(1) { sleep_time = fuse_clean_cache(f); sleep(sleep_time); diff --git a/lib/fuse_loop_mt.c b/lib/fuse_loop_mt.c index 0e79b49..95316f7 100644 --- a/lib/fuse_loop_mt.c +++ b/lib/fuse_loop_mt.c @@ -8,6 +8,8 @@ See the file COPYING.LIB. */ +#define _GNU_SOURCE + #include "fuse_config.h" #include "fuse_lowlevel.h" #include "fuse_misc.h" @@ -130,6 +132,8 @@ static void *fuse_do_work(void *data) struct fuse_worker *w = (struct fuse_worker *) data; struct fuse_mt *mt = w->mt; + pthread_setname_np(pthread_self(), "fuse_worker"); + while (!fuse_session_exited(mt->se)) { int isforget = 0; int res;