sync: deemphasize goroutines in RWMutex documentation

Fixes #41555

Change-Id: I46b9535b1687d481d2ac76296e8ba7de26d6e2e2

Change-Id: I46b9535b1687d481d2ac76296e8ba7de26d6e2e2
GitHub-Last-Rev: 38af46c189
GitHub-Pull-Request: golang/go#61977
Reviewed-on: https://go-review.googlesource.com/c/go/+/518859
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
This commit is contained in:
qiulaidongfeng 2023-08-15 02:13:47 +00:00 committed by Gopher Robot
parent dc6513b89f
commit a35bb44adc
1 changed files with 5 additions and 6 deletions

View File

@ -19,12 +19,11 @@ import (
// //
// A RWMutex must not be copied after first use. // A RWMutex must not be copied after first use.
// //
// If a goroutine holds a RWMutex for reading and another goroutine might // If any goroutine calls Lock while the lock is already held by
// call Lock, no goroutine should expect to be able to acquire a read lock // one or more readers, concurrent calls to RLock will block until
// until the initial read lock is released. In particular, this prohibits // the writer has acquired (and released) the lock, to ensure that
// recursive read locking. This is to ensure that the lock eventually becomes // the lock eventually becomes available to the writer.
// available; a blocked Lock call excludes new readers from acquiring the // Note that this prohibits recursive read-locking.
// lock.
// //
// In the terminology of the Go memory model, // In the terminology of the Go memory model,
// the n'th call to Unlock “synchronizes before” the m'th call to Lock // the n'th call to Unlock “synchronizes before” the m'th call to Lock