HomeFreeBSD

Fix the turnstile_lock() KPI.

Description

Fix the turnstile_lock() KPI.

turnstile_{lock,unlock}() were added for use in epoch. turnstile_lock()
returned NULL to indicate that the calling thread had lost a race and
the turnstile was no longer associated with the given lock, or the lock
owner. However, reader-writer locks may not have a designated owner,
in which case turnstile_lock() would return NULL and
epoch_block_handler_preempt() would leak spinlocks as a result.

Apply a minimal fix: return the lock owner as a separate return value.

Reviewed by: kib
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21048

Details

Provenance
markjAuthored on Jul 24 2019, 11:04 PM
Parents
rGae5f2ca7b9c5: Fix several related coverity issues:
Branches
Unknown
Tags
Unknown

Event Timeline