From 600221e723e1918a8ecdc26bcf9c966be16a4068 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 20 Oct 2014 00:17:11 +0200 Subject: osdep: limit thread names to 16 characters It turns out the glibc people are very clever and return an error if the thread name exceeds the maximum supported kernel length, instead of truncating the name. So everyone has to hardcode the currently allowed Linux kernel name length limit, even if it gets extended later. Also the Lua script filenames could get too long; use the client name instead. Another strange thing is that on Linux, unrelated threads "inherit" the name by the thread they were created. This leads to random thread names, because there's not necessarily a strong relation between these threads (e.g. script command leads to filter recreation -> the filter's threads are tagged with the script's thread name). Unfortunate. --- player/scripting.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'player/scripting.c') diff --git a/player/scripting.c b/player/scripting.c index 935bbd0490..982d64a3cd 100644 --- a/player/scripting.c +++ b/player/scripting.c @@ -80,7 +80,7 @@ static void *script_thread(void *p) struct thread_arg *arg = p; char name[90]; - snprintf(name, sizeof(name), "script (%s)", arg->fname); + snprintf(name, sizeof(name), "lua (%s)", mpv_client_name(arg->client)); mpthread_set_name(name); if (arg->backend->load(arg->client, arg->fname) < 0) -- cgit v1.2.3