]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kern/task.c
xnu-2422.90.20.tar.gz
[apple/xnu.git] / osfmk / kern / task.c
index d39ed204701a5bca0b9fa575c0c2849a50a0251a..aa5d2b36044d20c4ff97ec5491fa4e5a945fb3b4 100644 (file)
@@ -161,6 +161,9 @@ lck_attr_t      task_lck_attr;
 lck_grp_t       task_lck_grp;
 lck_grp_attr_t  task_lck_grp_attr;
 
+/* Flag set by core audio when audio is playing. Used to stifle EXC_RESOURCE generation when active. */
+int audio_active = 0;
+
 zinfo_usage_store_t tasks_tkm_private;
 zinfo_usage_store_t tasks_tkm_shared;
 
@@ -3598,6 +3601,11 @@ THIS_PROCESS_IS_CAUSING_TOO_MANY_WAKEUPS__SENDING_EXC_RESOURCE(void)
                        "supressed by a boot-arg\n", procname, pid);
                return;
        }
+       if (audio_active) {
+               printf("process %s[%d] caught causing excessive wakeups. EXC_RESOURCE "
+                      "supressed due to audio playback\n", procname, pid);
+               return;
+       }
        printf("process %s[%d] caught causing excessive wakeups. Observed wakeups rate "
                "(per sec): %lld; Maximum permitted wakeups rate (per sec): %lld; Observation "
                "period: %lld seconds; Task lifetime number of wakeups: %lld\n",