Page MenuHomeFreeBSD

lib/libc/net/nsdispatch.c: Fix missing unlock and add locking annotations
ClosedPublic

Authored by arichardson on Mar 22 2021, 10:27 AM.
Tags
None
Referenced Files
F151141003: D29372.id86300.diff
Mon, Apr 6, 9:07 AM
F151050682: D29372.id86131.diff
Sun, Apr 5, 4:10 PM
Unknown Object (File)
Sun, Apr 5, 1:01 PM
Unknown Object (File)
Sun, Apr 5, 11:49 AM
Unknown Object (File)
Fri, Apr 3, 1:09 PM
Unknown Object (File)
Tue, Mar 31, 6:29 PM
Unknown Object (File)
Tue, Mar 31, 4:31 AM
Unknown Object (File)
Mon, Mar 30, 10:19 PM
Subscribers

Details

Summary

The error cases (goto fin) of _nsdispatch were missing the unlock.

This change also drops the checks for __isthreaded since the pthread stubs
are already no-ops if threads are not being used. Dropping those conditionals
allows clang's thread safety analysis to deal with the file and also makes
the code a bit more readable. While touching the file also add a few more
assertions in debug mode that the right locks are held.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable