+ lck_mtx_unlock(mutex);
+
+ code64 = (behavior & MACH_EXCEPTION_CODES);
+ behavior &= ~MACH_EXCEPTION_CODES;
+
+ if (!code64) {
+ small_code[0] = CAST_DOWN_EXPLICIT(exception_data_type_t, code[0]);
+ small_code[1] = CAST_DOWN_EXPLICIT(exception_data_type_t, code[1]);
+ }
+
+ task = thread->task;
+
+#if CONFIG_MACF
+ /* Now is a reasonably good time to check if the exception action is
+ * permitted for this process, because after this point we will send
+ * the message out almost certainly.
+ * As with other failures, exception_triage_thread will go on
+ * to the next level.
+ */
+ if (mac_exc_action_check_exception_send(task, excp) != 0) {
+ return KERN_FAILURE;
+ }
+#endif
+
+ if ((thread != current_thread() || exception == EXC_CORPSE_NOTIFY)
+ && behavior != EXCEPTION_STATE) {
+ use_fast_retrieve = FALSE;
+
+ task_reference(task);
+ task_port = convert_task_to_port(task);
+ /* task ref consumed */
+ thread_reference(thread);
+ thread_port = convert_thread_to_port(thread);
+ /* thread ref consumed */
+
+ }