- while (!simple_lock_try(&kprintf_lock, LCK_GRP_NULL)) {
- (void) cpu_signal_handler(NULL);
- }
+ in_panic_context = processor_in_panic_context(current_processor());
+
+ // If current CPU is in panic context, be a little more impatient.
+ kprintf_lock_grabbed = simple_lock_try_lock_mp_signal_safe_loop_duration(&kprintf_lock,
+ in_panic_context ? KPRINTF_LOCKWAIT_IMPATIENT : KPRINTF_LOCKWAIT_PATIENT,
+ LCK_GRP_NULL);