diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2024-04-03 09:28:07 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2024-04-03 09:28:55 +0000 |
commit | b97f8ad2aca605066b23a791778971c7ffc9f0c9 (patch) | |
tree | bd60a1549187a578f0f66b8d391a315ef141b32f | |
parent | 5c8257129bde7f44eddc7c5c7f5101b47987eea5 (diff) | |
download | ports-b97f8ad2aca605066b23a791778971c7ffc9f0c9.tar.gz ports-b97f8ad2aca605066b23a791778971c7ffc9f0c9.zip |
audio/pulseaudio: fix thread naming
This helps debuggin, at least procstat -kk shows the name of the threads
now.
-rw-r--r-- | audio/pulseaudio/Makefile | 2 | ||||
-rw-r--r-- | audio/pulseaudio/files/patch-src_pulsecore_thread-posix.c | 29 |
2 files changed, 30 insertions, 1 deletions
diff --git a/audio/pulseaudio/Makefile b/audio/pulseaudio/Makefile index c4a5229914bf..caf1e3cd2458 100644 --- a/audio/pulseaudio/Makefile +++ b/audio/pulseaudio/Makefile @@ -4,7 +4,7 @@ PORTNAME= pulseaudio DISTVERSION= 16.1 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= audio MASTER_SITES= https://freedesktop.org/software/pulseaudio/releases/ diff --git a/audio/pulseaudio/files/patch-src_pulsecore_thread-posix.c b/audio/pulseaudio/files/patch-src_pulsecore_thread-posix.c new file mode 100644 index 000000000000..6852385c0e47 --- /dev/null +++ b/audio/pulseaudio/files/patch-src_pulsecore_thread-posix.c @@ -0,0 +1,29 @@ +--- src/pulsecore/thread-posix.c.orig 2022-06-21 10:54:48 UTC ++++ src/pulsecore/thread-posix.c +@@ -71,6 +71,8 @@ static void* internal_thread_func(void *userdata) { + prctl(PR_SET_NAME, t->name); + #elif defined(HAVE_PTHREAD_SETNAME_NP) && defined(OS_IS_DARWIN) + pthread_setname_np(t->name); ++#elif defined(HAVE_PTHREAD_SETNAME_NP) && defined(OS_IS_FREEBSD) ++ pthread_setname_np(t->id, t->name); + #endif + + t->id = pthread_self(); +@@ -184,6 +186,8 @@ void pa_thread_set_name(pa_thread *t, const char *name + prctl(PR_SET_NAME, name); + #elif defined(HAVE_PTHREAD_SETNAME_NP) && defined(OS_IS_DARWIN) + pthread_setname_np(name); ++#elif defined(HAVE_PTHREAD_SETNAME_NP) && defined(OS_IS_FREEBSD) ++ pthread_setname_np(t->id, t->name); + #endif + } + +@@ -201,7 +205,7 @@ const char *pa_thread_get_name(pa_thread *t) { + t->name = NULL; + } + } +-#elif defined(HAVE_PTHREAD_GETNAME_NP) && defined(OS_IS_DARWIN) ++#elif defined(HAVE_PTHREAD_GETNAME_NP) && (defined(OS_IS_DARWIN) || defined(OS_IS_FREEBSD)) + if (!t->name) { + t->name = pa_xmalloc0(17); + pthread_getname_np(t->id, t->name, 16); |