HomeFreeBSD

mtx: pre-read the lock value in thread_lock_flags_

Description

mtx: pre-read the lock value in thread_lock_flags_

Since this function is effectively slow path, if we get here the lock is most
likely already taken in which case it is cheaper to not blindly attempt the
atomic op.

While here move hwpmc probe out of the loop to match other primitives.

Details

Provenance
mjgAuthored on
Parents
rS327393: rwlock: tidy up __rw_runlock_hard similarly to r325921
Branches
Unknown
Tags
Unknown