git: b97f8ad2aca6 - main - audio/pulseaudio: fix thread naming
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 03 Apr 2024 09:29:05 UTC
The branch main has been updated by bapt:
URL: https://cgit.FreeBSD.org/ports/commit/?id=b97f8ad2aca605066b23a791778971c7ffc9f0c9
commit b97f8ad2aca605066b23a791778971c7ffc9f0c9
Author: Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2024-04-03 09:28:07 +0000
Commit: Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2024-04-03 09:28:55 +0000
audio/pulseaudio: fix thread naming
This helps debuggin, at least procstat -kk shows the name of the threads
now.
---
audio/pulseaudio/Makefile | 2 +-
.../files/patch-src_pulsecore_thread-posix.c | 29 ++++++++++++++++++++++
2 files changed, 30 insertions(+), 1 deletion(-)
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);