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
F135155261: D29372.diff
Fri, Nov 7, 12:02 AM
Unknown Object (File)
Sat, Oct 25, 10:45 AM
Unknown Object (File)
Sat, Oct 25, 10:36 AM
Unknown Object (File)
Sat, Oct 25, 10:36 AM
Unknown Object (File)
Thu, Oct 23, 4:20 PM
Unknown Object (File)
Wed, Oct 22, 2:28 AM
Unknown Object (File)
Mon, Oct 13, 4:49 PM
Unknown Object (File)
Thu, Oct 9, 10:18 AM
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