From: Michael R Sweet Date: Thu, 27 Sep 2018 16:01:33 +0000 (-0400) Subject: Set QoS priority class for the main thread when running from launchd. X-Git-Tag: v2.3b6~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c3b8f53ada35cb3e7cef1c835dbde432e365042;p=thirdparty%2Fcups.git Set QoS priority class for the main thread when running from launchd. --- diff --git a/scheduler/main.c b/scheduler/main.c index e9d98720b9..4b3914ade5 100644 --- a/scheduler/main.c +++ b/scheduler/main.c @@ -17,6 +17,7 @@ #include #ifdef __APPLE__ # include +# include #endif /* __APPLE__ */ #ifdef HAVE_ASL_H # include @@ -1926,6 +1927,14 @@ service_checkin(void) count; /* Number of listeners */ int *ld_sockets; /* Listener sockets */ +# ifdef __APPLE__ + /* + * Force "user initiated" priority for the main thread... + */ + + pthread_set_qos_class_self_np(QOS_CLASS_USER_INITIATED, 0); +# endif /* __APPLE__ */ + /* * Check-in with launchd... */