runtime: decrement netpollWaiters in netpollunblock

We used to decrement it in netpollgoready, but that missed
the common case of a descriptor becoming ready due to I/O.
All calls to netpollgoready go through netpollunblock,
so this shouldn't miss any decrements we missed before.

Fixes #60782

Change-Id: Ideefefa1ac96ca38e09fe2dd5d595c5dd7883237
Reviewed-on: https://go-review.googlesource.com/c/go/+/503923
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Ian Lance Taylor 2023-06-15 17:41:19 -07:00 committed by Gopher Robot
parent 21ff9be0eb
commit eaa8419a72
3 changed files with 80 additions and 2 deletions

View file

@ -869,3 +869,12 @@ func TestPanicOnUnsafeSlice(t *testing.T) {
t.Errorf("output does not contain %q:\n%s", want, output)
}
}
func TestNetpollWaiters(t *testing.T) {
t.Parallel()
output := runTestProg(t, "testprognet", "NetpollWaiters")
want := "OK\n"
if output != want {
t.Fatalf("output is not %q\n%s", want, output)
}
}