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
Unknown Object (File)
Fri, Dec 5, 4:17 PM
Unknown Object (File)
Wed, Dec 3, 2:50 AM
Unknown Object (File)
Tue, Nov 25, 3:59 PM
Unknown Object (File)
Thu, Nov 20, 8:30 AM
Unknown Object (File)
Thu, Nov 20, 8:30 AM
Unknown Object (File)
Thu, Nov 20, 8:29 AM
Unknown Object (File)
Thu, Nov 20, 8:23 AM
Unknown Object (File)
Mon, Nov 10, 5:15 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