1
0
mirror of https://github.com/golang/go synced 2024-11-22 15:04:52 -07:00

sync: deemphasize goroutines in RWMutex documentation

Fixes #41555
Change-Id: I46b9535b1687d481d2ac76296e8ba7de26d6e2e2
This commit is contained in:
qiulaidongfeng 2023-08-12 17:42:43 +08:00
parent ac64a3628b
commit 38af46c189

View File

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