git: 896ba2348dd1 - main - devel/qt6-base: Support setting thread names
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 31 Oct 2025 03:47:02 UTC
The branch main has been updated by jhale:
URL: https://cgit.FreeBSD.org/ports/commit/?id=896ba2348dd148009fc3a62a3e0c23608028832f
commit 896ba2348dd148009fc3a62a3e0c23608028832f
Author: Kevin Zheng <kevinz5000@gmail.com>
AuthorDate: 2025-10-29 21:21:15 +0000
Commit: Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2025-10-31 03:46:30 +0000
devel/qt6-base: Support setting thread names
Thread names can now be set by calling QObject::setObjectName() before
starting the thread. Previously, the thread name would be the class name
of the runtime type of the thread object.
PR: 290676
MFH: 2025Q4
---
devel/qt6-base/Makefile | 2 +-
.../patch-src_corelib_thread_qthread__unix.cpp | 32 ++++++++++++++++++++++
2 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/devel/qt6-base/Makefile b/devel/qt6-base/Makefile
index fc95beff7d2e..623bd75568a4 100644
--- a/devel/qt6-base/Makefile
+++ b/devel/qt6-base/Makefile
@@ -1,6 +1,6 @@
PORTNAME= base
DISTVERSION= ${QT6_VERSION}
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= devel
PKGNAMEPREFIX= qt6-
diff --git a/devel/qt6-base/files/patch-src_corelib_thread_qthread__unix.cpp b/devel/qt6-base/files/patch-src_corelib_thread_qthread__unix.cpp
new file mode 100644
index 000000000000..50210c386ced
--- /dev/null
+++ b/devel/qt6-base/files/patch-src_corelib_thread_qthread__unix.cpp
@@ -0,0 +1,32 @@
+Support setting thread names via QObject::setObjectName().
+
+PR: 290676
+
+--- src/corelib/thread/qthread_unix.cpp.orig 2025-09-22 07:03:29 UTC
++++ src/corelib/thread/qthread_unix.cpp
+@@ -344,14 +344,14 @@ QAbstractEventDispatcher *QThreadPrivate::createEventD
+
+ #if QT_CONFIG(thread)
+
+-#if (defined(Q_OS_LINUX) || defined(Q_OS_DARWIN) || defined(Q_OS_QNX))
++#if (defined(Q_OS_LINUX) || defined(Q_OS_DARWIN) || defined(Q_OS_QNX) || defined(Q_OS_FREEBSD))
+ static void setCurrentThreadName(const char *name)
+ {
+ # if defined(Q_OS_LINUX) && !defined(QT_LINUXBASE)
+ prctl(PR_SET_NAME, (unsigned long)name, 0, 0, 0);
+ # elif defined(Q_OS_DARWIN)
+ pthread_setname_np(name);
+-# elif defined(Q_OS_QNX)
++# elif (defined(Q_OS_QNX) || defined(Q_OS_FREEBSD))
+ pthread_setname_np(pthread_self(), name);
+ # endif
+ }
+@@ -415,7 +415,7 @@ void *QThreadPrivate::start(void *arg)
+ data->ensureEventDispatcher();
+ data->eventDispatcher.loadRelaxed()->startingUp();
+
+-#if (defined(Q_OS_LINUX) || defined(Q_OS_DARWIN) || defined(Q_OS_QNX))
++#if (defined(Q_OS_LINUX) || defined(Q_OS_DARWIN) || defined(Q_OS_QNX) || defined(Q_OS_FREEBSD))
+ {
+ // Sets the name of the current thread. We can only do this
+ // when the thread is starting, as we don't have a cross