FreeBSD/sys/kern/kern_umtx.c
/*
 * Unlock a userland POSIX mutex.
 */
Unlock a userland POSIX mutex.
Unlock a userland POSIX mutex .
static int
do_unlock_umutex(struct thread *td, struct umutex *m, bool rb)
{
	uint32_t flags;
	int error;
	error = fueword32(&m->m_flags, &flags);
	if (error == -1)
		return (EFAULT);
	switch (flags & (UMUTEX_PRIO_INHERIT | UMUTEX_PRIO_PROTECT)) {
	case 0:
		return (do_unlock_normal(td, m, flags, rb));
	case UMUTEX_PRIO_INHERIT:
		return (do_unlock_pi(td, m, flags, rb));
	case UMUTEX_PRIO_PROTECT:
		return (do_unlock_pp(td, m, flags, rb));
	}
	return (EINVAL);
}
static int do_unlock_umutex ( struct thread * td , struct umutex * m , bool rb ) { uint32_t flags ; int error ; error = fueword32 ( & m -> m_flags , & flags ) ; if ( error == -1 ) return ( EFAULT ) ; switch ( flags & ( UMUTEX_PRIO_INHERIT | UMUTEX_PRIO_PROTECT ) ) { case 0 : return ( do_unlock_normal ( td , m , flags , rb ) ) ; case UMUTEX_PRIO_INHERIT : return ( do_unlock_pi ( td , m , flags , rb ) ) ; case UMUTEX_PRIO_PROTECT : return ( do_unlock_pp ( td , m , flags , rb ) ) ; } return ( EINVAL ) ; }
Unlock a userland POSIX mutex.
Unlock a userland POSIX mutex .