--- src/llvm-project/llvm/lib/Support/Unix/Threading.inc.orig	2023-05-31 12:29:26
+++ src/llvm-project/llvm/lib/Support/Unix/Threading.inc	2023-06-02 19:06:46
@@ -22,7 +22,6 @@
 #if defined(__APPLE__)
 #include <mach/mach_init.h>
 #include <mach/mach_port.h>
-#include <pthread/qos.h>
 #include <sys/sysctl.h>
 #include <sys/types.h>
 #endif
@@ -276,17 +275,8 @@
   // minutes to complete. Examples include downloading a document or importing
   // data. This class offers a balance between responsiveness, performance, and
   // energy efficiency.
-  const auto qosClass = [&]() {
-    switch (Priority) {
-    case ThreadPriority::Background:
-      return QOS_CLASS_BACKGROUND;
-    case ThreadPriority::Low:
-      return QOS_CLASS_UTILITY;
-    case ThreadPriority::Default:
-      return QOS_CLASS_DEFAULT;
-    }
-  }();
-  return !pthread_set_qos_class_self_np(qosClass, 0)
+  return !setpriority(PRIO_DARWIN_THREAD, 0,
+                      Priority == ThreadPriority::Default ? 0 : PRIO_DARWIN_BG)
              ? SetThreadPriorityResult::SUCCESS
              : SetThreadPriorityResult::FAILURE;
 #endif
