#define LAUNCH_JOBKEY_MACH_HOSTSPECIALPORT "HostSpecialPort"
#define LAUNCH_JOBKEY_MACH_ENTERKERNELDEBUGGERONCLOSE "EnterKernelDebuggerOnClose"
#define LAUNCH_JOBKEY_LOWPRIORITYBACKGROUNDIO "LowPriorityBackgroundIO"
+#define LAUNCH_JOBKEY_LEGACYTIMERS "LegacyTimers"
#define LAUNCH_ENV_INSTANCEID "LaunchInstanceID"
and this key should only be used if an app's ability to be responsive depends
on it, and cannot be made Adaptive.
.El
+.It Sy LegacyTimers <boolean>
+This optional key controls the behavior of timers created by the job. By default
+on OS X Mavericks version 10.9 and later, timers created by launchd jobs are
+coalesced. Batching the firing of timers with similar deadlines improves the
+overall energy efficiency of the system. If this key is set to true, timers
+created by the job will opt into less efficient but more precise behavior and
+not be coalesced with other timers.
.It Sy AbandonProcessGroup <boolean>
When a job dies,
.Nm launchd
implicit_reap:1,
system_app :1,
joins_gui_session :1,
- low_priority_background_io :1;
+ low_priority_background_io :1,
+ legacy_timers :1;
const char label[0];
};
} else if (strcasecmp(key, LAUNCH_JOBKEY_LOWPRIORITYBACKGROUNDIO) == 0) {
j->low_priority_background_io = true;
found_key = true;
+ } else if (strcasecmp(key, LAUNCH_JOBKEY_LEGACYTIMERS) == 0) {
+#if !TARGET_OS_EMBEDDED
+ j->legacy_timers = value;
+#else // !TARGET_OS_EMBEDDED
+ job_log(j, LOG_ERR, "This key is not supported on this platform: %s", key);
+#endif // !TARGET_OS_EMBEDDED
+ found_key = true;
}
break;
case 'm':
.task_throughput_qos_tier = THROUGHPUT_QOS_LAUNCH_DEFAULT_TIER,
};
- kr = task_policy_set(mach_task_self(), TASK_BASE_QOS_POLICY, (task_policy_t)&qosinfo, TASK_QOS_POLICY_COUNT);
- (void)job_assumes_zero_p(j, kr);
+ if (!j->legacy_timers) {
+ kr = task_policy_set(mach_task_self(), TASK_BASE_QOS_POLICY, (task_policy_t)&qosinfo, TASK_QOS_POLICY_COUNT);
+ (void)job_assumes_zero_p(j, kr);
+ }
#endif
#if HAVE_RESPONSIBILITY