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)
Wed, Apr 9, 2:02 PM
Unknown Object (File)
Sun, Mar 30, 8:42 AM
Unknown Object (File)
Sun, Mar 30, 7:23 AM
Unknown Object (File)
Mar 11 2025, 6:59 PM
Unknown Object (File)
Feb 28 2025, 9:55 AM
Unknown Object (File)
Feb 17 2025, 4:00 AM
Unknown Object (File)
Jan 31 2025, 6:22 AM
Unknown Object (File)
Nov 30 2024, 9:37 AM
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.