HomeFreeBSD

Fix compat10 semaphore interface race

Description

Fix compat10 semaphore interface race

Wrong has-waiters and missing unconditional _count==0 check may cause
infinite waiting with already non-zero count.

  1. properly clear _has_waiters flag when waiting failed to start
  2. always check _count before start waiting

PR: 265997
Reviewed by: kib
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36272

Details

Provenance
firk_cantconnect.ruAuthored on Aug 26 2022, 8:05 AM
kibCommitted on Aug 26 2022, 5:34 PM
Reviewer
kib
Differential Revision
D36272: Fix old semaphore interface race
Parents
rGa358db560370: socket(2): bring documentation up tp date
Branches
Unknown
Tags
Unknown