commit 8d73b933b1a5af0cc15c2d680f077944780bf53d
parent 2133e66f54eb62c4e5047a4188f1cc8ddddf1318
Author: Markus Stange <mstange.moz@gmail.com>
Date: Thu, 23 Oct 2025 16:07:53 +0000
Bug 1996052 - Limit the default QOS change from bug 1995638 to macOS 26+ (Tahoe or later), to minimize risk. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D269786
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/xpcom/threads/nsThread.cpp b/xpcom/threads/nsThread.cpp
@@ -85,6 +85,8 @@ using GetCurrentThreadStackLimitsFn = void(WINAPI*)(PULONG_PTR LowLimit,
# include <mach/mach.h>
# include <mach/thread_policy.h>
# include <sys/qos.h>
+
+# include "nsCocoaFeatures.h"
#endif
#ifdef MOZ_CANARY
@@ -338,8 +340,11 @@ void nsThread::ThreadFunc(void* aArg) {
self->InitCommon();
#ifdef XP_MACOSX
- // Use "User Initiated" as the default quality of service.
- pthread_set_qos_class_self_np(QOS_CLASS_USER_INITIATED, 0);
+ if (nsCocoaFeatures::OnTahoeOrLater()) {
+ // On macOS 26+, use "User Initiated" as the default quality of service.
+ // It may make sense to do this on all versions of macOS.
+ pthread_set_qos_class_self_np(QOS_CLASS_USER_INITIATED, 0);
+ }
#endif
// Inform the ThreadManager