From 32ee81d9776805dec74921242edcbe05394bc5cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Tue, 12 Dec 2023 16:38:36 +0100 Subject: [PATCH] pipewire: data-loop: set thread name Set the name of the thread running the data loop to "pw-data-loop" for easier identification in debuggers, htop, etc. --- src/pipewire/data-loop.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pipewire/data-loop.c b/src/pipewire/data-loop.c index ff68ac759..a3e57bef4 100644 --- a/src/pipewire/data-loop.c +++ b/src/pipewire/data-loop.c @@ -188,7 +188,12 @@ int pw_data_loop_start(struct pw_data_loop *loop) if ((utils = loop->thread_utils) == NULL) utils = pw_thread_utils_get(); - thr = spa_thread_utils_create(utils, NULL, do_loop, loop); + + static const struct spa_dict_item items[] = { + { SPA_KEY_THREAD_NAME, "pw-data-loop" }, + }; + + thr = spa_thread_utils_create(utils, &SPA_DICT_INIT_ARRAY(items), do_loop, loop); loop->thread = (pthread_t)thr; if (thr == NULL) { pw_log_error("%p: can't create thread: %m", loop);