Page MenuHomeFreeBSD

Fix cv_waiters wraparound bug
ClosedPublic

Authored by markj on Jan 8 2016, 12:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 14, 12:23 AM
Unknown Object (File)
Sun, Oct 26, 8:26 AM
Unknown Object (File)
Sun, Oct 26, 3:59 AM
Unknown Object (File)
Tue, Oct 21, 10:32 AM
Unknown Object (File)
Thu, Oct 16, 2:21 PM
Unknown Object (File)
Oct 13 2025, 11:32 PM
Unknown Object (File)
Oct 13 2025, 11:32 PM
Unknown Object (File)
Oct 13 2025, 11:32 PM
Subscribers

Details

Summary

This is another attempt to fix the issue described in r282971, which was
reverted in r283250. Rather than eliminating cv_waiters entirely, cap
its value at INT_MAX and modify cv_signal() to handle that case
appropriately. In particular, this lets us avoid looking up the
sleepqueue on every call to cv_signal().

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj retitled this revision from to Fix cv_waiters wraparound bug.
markj edited the test plan for this revision. (Show Details)
markj updated this object.

Don't assert cv_waiters == 0 in cv_destroy().

It may be non-zero even with zero sleepers, since threads don't
decrement it when they wake up.

jhb edited edge metadata.
This revision is now accepted and ready to land.Jan 8 2016, 6:56 PM
This revision was automatically updated to reflect the committed changes.