diff options
| author | Jack Mordaunt <jackmordaunt.dev@gmail.com> | 2025-06-05 15:38:04 -0300 |
|---|---|---|
| committer | Jack Mordaunt <jackmordaunt.dev@gmail.com> | 2025-06-12 16:14:52 -0300 |
| commit | d5b7302ac047dd4c5ee9656d405c84268e27b242 (patch) | |
| tree | 156c8b53f30274eec77252d6c9e1a441ecb27dd6 /src/types.cpp | |
| parent | be873af003817f7b29ddbd44a4218716d94479dd (diff) | |
core/sync.try_select_raw: fix TOCTOU
Fixes a TOCTOU where the channel could be used between the call to
can_{recv,send} and {recv,send} causing an unexpected blocking
operation.
To do this we use the non-blocking try_{recv,send} and retry the check
in a loop. This guarantees non-blocking select behaviour, at the cost of
spinning if the input channels are highly contended.
Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Diffstat (limited to 'src/types.cpp')
0 files changed, 0 insertions, 0 deletions