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
F163076195: D29372.diff
Sun, Jul 19, 9:06 PM
Unknown Object (File)
Sat, Jul 18, 3:39 AM
Unknown Object (File)
Wed, Jul 1, 2:39 AM
Unknown Object (File)
Tue, Jun 30, 7:10 AM
Unknown Object (File)
Sun, Jun 28, 8:39 AM
Unknown Object (File)
Jun 9 2026, 11:53 AM
Unknown Object (File)
Jun 8 2026, 2:23 AM
Unknown Object (File)
May 7 2026, 12:17 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