Skip to content

Commit

Permalink
Merge branch 'main' into dev/picking-transparent
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelflinger authored Oct 16, 2024
2 parents fa75f1f + e8f3fc5 commit e9f8085
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions libs/utils/src/JobSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,30 @@ void JobSystem::setThreadPriority(Priority priority) noexcept {
slog.w << "setpriority failed: " << strerror(errno) << io::endl;
}
#endif
#elif defined(__APPLE__)
qos_class_t qosClass = QOS_CLASS_DEFAULT;
switch (priority) {
case Priority::BACKGROUND:
qosClass = QOS_CLASS_BACKGROUND;
break;
case Priority::NORMAL:
qosClass = QOS_CLASS_DEFAULT;
break;
case Priority::DISPLAY:
qosClass = QOS_CLASS_USER_INTERACTIVE;
break;
case Priority::URGENT_DISPLAY:
qosClass = QOS_CLASS_USER_INTERACTIVE;
break;
}
errno = 0;
UTILS_UNUSED_IN_RELEASE int error;
error = pthread_set_qos_class_self_np(qosClass, 0);
#ifndef NDEBUG
if (UTILS_UNLIKELY(error)) {
slog.w << "pthread_set_qos_class_self_np failed: " << strerror(errno) << io::endl;
}
#endif
#endif
}

Expand Down

0 comments on commit e9f8085

Please sign in to comment.