CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2024/01/07 12:44:28
Modified files:
lib/libc/thread: synch.h
lib/librthread : synch.h
Log message:
libc, librthread: _twait: subtraction is not comparison
Compare the current time with the absolute timeout before computing
the relative timeout to avoid arithmetic overflow. Fixes a bug where
large negative absolute timeouts are subtracted into large positive
relative timeouts and incorrectly cause the caller to block.
While here, use timespeccmp(3) and timespecsub(3) to simplify the
code.
Thread: https://marc.info/?l=openbsd-tech&m=169945962503129&w=2