]> Cypherpunks repositories - gostls13.git/commit
os: use poll.fdMutex for Plan 9 files
authorIan Lance Taylor <iant@golang.org>
Tue, 4 Oct 2022 21:35:39 +0000 (14:35 -0700)
committerGopher Robot <gobot@golang.org>
Sat, 8 Oct 2022 03:57:40 +0000 (03:57 +0000)
commit4fe1971b2dff1fa14cb8f5be47aed7fda76c0f7c
treedc3dbd8b4e173595674c520a1860fbcb0b17ac97
parent669ec549b554ef7fe957bf284271ed3b7db82da1
os: use poll.fdMutex for Plan 9 files

This permits us to safely support concurrent access to files on Plan 9.
Concurrent access was already safe on other systems.

This does introduce a change: if one goroutine calls a blocking read
on a pipe, and another goroutine closes the pipe, then before this CL
the close would occur. Now the close will be delayed until the blocking
read completes.

Also add tests that concurrent I/O and Close on a pipe are OK.

For #50436
For #56043

Change-Id: I969c869ea3b8c5c2f2ef319e441a56a3c64e7bf5
Reviewed-on: https://go-review.googlesource.com/c/go/+/438347
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: David du Colombier <0intro@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
src/internal/poll/export_test.go
src/internal/poll/fd_mutex_test.go
src/internal/poll/file_plan9.go [new file with mode: 0644]
src/os/file_mutex_plan9.go [new file with mode: 0644]
src/os/file_plan9.go
src/os/os_test.go
src/os/stat_plan9.go
src/os/types_plan9.go