Files

31 lines
1.1 KiB
Diff
Raw Permalink Normal View History

2023-08-21 09:09:47 -07:00
--- 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>
2023-08-21 09:09:47 -07:00
#include <sys/sysctl.h>
#include <sys/types.h>
#endif
2023-08-21 09:09:47 -07:00
@@ -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) {
2023-08-21 09:09:47 -07:00
- 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