]> Cypherpunks repositories - gostls13.git/commit
internal/poll: make waitIO more idempontent
authorqmuntal <quimmuntal@gmail.com>
Thu, 5 Feb 2026 12:16:12 +0000 (13:16 +0100)
committerQuim Muntal <quimmuntal@gmail.com>
Fri, 6 Feb 2026 20:27:40 +0000 (12:27 -0800)
commitf58a6a8e34d7db14871f2cf9bfd657e44a5c8b7b
tree82fefb6652a419804dc5c0cb35a6cb0c7ccb94c0
parent9263a71b92e84aa34d0e35887d5c23f5a0a21537
internal/poll: make waitIO more idempontent

This is a step towards deferring adding the handle to IOCP until the
first IO operation.

waitIO should use the overlapped event if it is provided, regardless of
whether FD is pollable or not. This simplifies reasoning about the code
and makes it more robust to race conditions.

While here, remove the panic in waitIO that was triggered when called
with a blocking handle. That shouldn't happen, but if it does,
fd.pd.wait will return an error that will already be promoted to
a panic.

For #76391

Change-Id: I8e84592568a3ef66e71161eb2c5f515dde638117
Reviewed-on: https://go-review.googlesource.com/c/go/+/742280
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/internal/poll/fd_windows.go