mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
Set public thread name
This allows to identify Ardour thread using standard unix tools (ps, htop) and inspect priorities, CPU load etc.
This commit is contained in:
parent
f81442c3bf
commit
d6a38d5450
1 changed files with 8 additions and 0 deletions
|
|
@ -153,6 +153,14 @@ pthread_set_name (const char *str)
|
|||
/* copy string and delete it when exiting */
|
||||
|
||||
thread_name.set (strdup (str)); // leaks
|
||||
|
||||
#if !defined PLATFORM_WINDOWS && defined _GNU_SOURCE
|
||||
/* set public thread name, up to 16 chars */
|
||||
char ptn[16];
|
||||
memset (ptn, 0, 16);
|
||||
strncpy (ptn, str, 15);
|
||||
pthread_setname_np (pthread_self(), ptn);
|
||||
#endif
|
||||
}
|
||||
|
||||
const char *
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue