]> Cypherpunks repositories - gostls13.git/commit
os: make File.Readdir et al concurrency-safe
authorAlan Donovan <adonovan@google.com>
Fri, 12 Apr 2024 20:08:22 +0000 (16:08 -0400)
committerAlan Donovan <adonovan@google.com>
Mon, 15 Apr 2024 20:52:06 +0000 (20:52 +0000)
commitca94e9e223888d6d99a8f7b559f08bb59d2cc5fd
treed03cbd7f16a89c0912f9e5278f4d05a2a0145520
parent7418d419afeeaa832bd5c9104f1ff90331eaf184
os: make File.Readdir et al concurrency-safe

Before, all methods of File (including Close) were
safe for concurrent use (I checked), except the three
variants of ReadDir.

This change makes the ReadDir operations
atomic too, and documents explicitly that all methods
of File have this property, which was already implied
by the package documentation.

Fixes #66498

Change-Id: I05c88b4e60b44c702062e99ed8f4a32e7945927a
Reviewed-on: https://go-review.googlesource.com/c/go/+/578322
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/os/dir_darwin.go
src/os/dir_plan9.go
src/os/dir_unix.go
src/os/dir_windows.go
src/os/file.go
src/os/file_plan9.go
src/os/file_unix.go
src/os/file_windows.go
src/os/types.go