FreeBSD/sys/compat/cloudabi/cloudabi_futex.c
/* Sets an owner of a lock, based on a userspace lock value. */
Sets an owner of a lock, based on a userspace lock value.
Sets an owner of a lock based on a userspace lock value .
static void
futex_lock_set_owner(struct futex_lock *fl, cloudabi_lock_t lock)
{
	if ((lock & ~CLOUDABI_LOCK_WRLOCKED) == 0) {
		fl->fl_owner = LOCK_OWNER_UNKNOWN;
		return;
	}
	lock &= ~(CLOUDABI_LOCK_WRLOCKED | CLOUDABI_LOCK_KERNEL_MANAGED);
	if (lock == LOCK_UNMANAGED) {
		fl->fl_owner = LOCK_OWNER_UNKNOWN;
		return;
	}
	fl->fl_owner = lock;
}
static void futex_lock_set_owner ( struct futex_lock * fl , cloudabi_lock_t lock ) { if ( ( lock & ~ CLOUDABI_LOCK_WRLOCKED ) == 0 ) { fl -> fl_owner = LOCK_OWNER_UNKNOWN ; return ; } lock &= ~ ( CLOUDABI_LOCK_WRLOCKED | CLOUDABI_LOCK_KERNEL_MANAGED ) ; if ( lock == LOCK_UNMANAGED ) { fl -> fl_owner = LOCK_OWNER_UNKNOWN ; return ; } fl -> fl_owner = lock ; }
Sets an owner of a lock, based on a userspace lock value.
Sets an owner of a lock based on a userspace lock value .
/* Lock has no explicit owner. */ /* Don't allow userspace to silently unlock. */