MCPcopy Create free account
hub / github.com/F-Stack/f-stack / _mtx_lock_indefinite_check

Function _mtx_lock_indefinite_check

freebsd/kern/kern_mutex.c:1228–1251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1226}
1227
1228static void __noinline
1229_mtx_lock_indefinite_check(struct mtx *m, struct lock_delay_arg *ldap)
1230{
1231 struct thread *td;
1232
1233 ldap->spin_cnt++;
1234 if (ldap->spin_cnt < 60000000 || kdb_active || KERNEL_PANICKED())
1235 cpu_lock_delay();
1236 else {
1237 td = mtx_owner(m);
1238
1239 /* If the mutex is unlocked, try again. */
1240 if (td == NULL)
1241 return;
1242
1243 printf( "spin lock %p (%s) held by %p (tid %d) too long\n",
1244 m, m->lock_object.lo_name, td, td->td_tid);
1245#ifdef WITNESS
1246 witness_display_spinlock(&m->lock_object, td, printf);
1247#endif
1248 panic("spin lock held too long");
1249 }
1250 cpu_spinwait();
1251}
1252
1253void
1254mtx_spin_wait_unlocked(struct mtx *m)

Callers 3

_mtx_lock_spin_cookieFunction · 0.85
thread_lock_flags_Function · 0.85
mtx_spin_wait_unlockedFunction · 0.85

Calls 4

cpu_lock_delayFunction · 0.85
witness_display_spinlockFunction · 0.85
printfFunction · 0.70
panicFunction · 0.70

Tested by

no test coverage detected