mirror of
https://github.com/golang/go
synced 2024-11-23 18:20:04 -07:00
sync: consistently use article "a" for RWMutex
We used a mix of both before. I've never heard anybody say "an arr-double you mutex" when speaking. Fixes #23457 Change-Id: I802b5eb2339f885ca9d24607eeda565763165298 Reviewed-on: https://go-review.googlesource.com/87896 Reviewed-by: Andrew Bonventre <andybons@golang.org>
This commit is contained in:
parent
2d6f941e8c
commit
165e7523fb
@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
// This is a copy of sync/rwmutex.go rewritten to work in the runtime.
|
// This is a copy of sync/rwmutex.go rewritten to work in the runtime.
|
||||||
|
|
||||||
// An rwmutex is a reader/writer mutual exclusion lock.
|
// A rwmutex is a reader/writer mutual exclusion lock.
|
||||||
// The lock can be held by an arbitrary number of readers or a single writer.
|
// The lock can be held by an arbitrary number of readers or a single writer.
|
||||||
// This is a variant of sync.RWMutex, for the runtime package.
|
// This is a variant of sync.RWMutex, for the runtime package.
|
||||||
// Like mutex, rwmutex blocks the calling M.
|
// Like mutex, rwmutex blocks the calling M.
|
||||||
|
@ -13,11 +13,11 @@ import (
|
|||||||
// There is a modified copy of this file in runtime/rwmutex.go.
|
// There is a modified copy of this file in runtime/rwmutex.go.
|
||||||
// If you make any changes here, see if you should make them there.
|
// If you make any changes here, see if you should make them there.
|
||||||
|
|
||||||
// An RWMutex is a reader/writer mutual exclusion lock.
|
// A RWMutex is a reader/writer mutual exclusion lock.
|
||||||
// The lock can be held by an arbitrary number of readers or a single writer.
|
// The lock can be held by an arbitrary number of readers or a single writer.
|
||||||
// The zero value for a RWMutex is an unlocked mutex.
|
// The zero value for a RWMutex is an unlocked mutex.
|
||||||
//
|
//
|
||||||
// An 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 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
|
// call Lock, no goroutine should expect to be able to acquire a read lock
|
||||||
@ -108,7 +108,7 @@ func (rw *RWMutex) Lock() {
|
|||||||
// not locked for writing on entry to Unlock.
|
// not locked for writing on entry to Unlock.
|
||||||
//
|
//
|
||||||
// As with Mutexes, a locked RWMutex is not associated with a particular
|
// As with Mutexes, a locked RWMutex is not associated with a particular
|
||||||
// goroutine. One goroutine may RLock (Lock) an RWMutex and then
|
// goroutine. One goroutine may RLock (Lock) a RWMutex and then
|
||||||
// arrange for another goroutine to RUnlock (Unlock) it.
|
// arrange for another goroutine to RUnlock (Unlock) it.
|
||||||
func (rw *RWMutex) Unlock() {
|
func (rw *RWMutex) Unlock() {
|
||||||
if race.Enabled {
|
if race.Enabled {
|
||||||
|
Loading…
Reference in New Issue
Block a user