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

Function umtx_handle_rb

freebsd/kern/kern_umtx.c:4598–4617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4596}
4597
4598static int
4599umtx_handle_rb(struct thread *td, uintptr_t rbp, uintptr_t *rb_list, bool inact,
4600 bool compat32)
4601{
4602 struct umutex m;
4603 int error;
4604
4605 KASSERT(td->td_proc == curproc, ("need current vmspace"));
4606 error = copyin((void *)rbp, &m, sizeof(m));
4607 if (error != 0)
4608 return (error);
4609 if (rb_list != NULL)
4610 umtx_read_rb_list(td, &m, rb_list, compat32);
4611 if ((m.m_flags & UMUTEX_ROBUST) == 0)
4612 return (EINVAL);
4613 if ((m.m_owner & ~UMUTEX_CONTESTED) != td->td_tid)
4614 /* inact is cleared after unlock, allow the inconsistency */
4615 return (inact ? 0 : EINVAL);
4616 return (do_unlock_umutex(td, (struct umutex *)rbp, true));
4617}
4618
4619static void
4620umtx_cleanup_rb_list(struct thread *td, uintptr_t rb_list, uintptr_t *rb_inact,

Callers 2

umtx_cleanup_rb_listFunction · 0.85
umtx_thread_cleanupFunction · 0.85

Calls 3

umtx_read_rb_listFunction · 0.85
do_unlock_umutexFunction · 0.85
copyinFunction · 0.50

Tested by

no test coverage detected