HomeFreeBSD

MFC r327394,r327395:

Description

MFC r327394,r327395:

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.
mtx: deduplicate indefinite wait check in spinlocks and thread lock

Details

Provenance
mjgAuthored on
Parents
rS327476: shutdown: Assume absolute time is in the future
Branches
Unknown
Tags
Unknown