aboutsummaryrefslogtreecommitdiff
path: root/src/sync
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2017-06-15 16:42:08 -0700
committerIan Lance Taylor <iant@golang.org>2017-06-19 17:40:38 +0000
commit09ebbf408530b82f1a817e2f648e1c5618eeb1ab (patch)
tree52a58a8e584a8f1d9a90605e1db41d6e725df626 /src/sync
parent6c2458e72d85dd0d388e4d27b6b361899084d526 (diff)
downloadgo-09ebbf408530b82f1a817e2f648e1c5618eeb1ab.tar.xz
runtime: add read/write mutex type
This is a runtime version of sync.RWMutex that can be used by code in the runtime package. The type is not quite the same, in that the zero value is not valid. For future use by CL 43713. Updates #19546 Change-Id: I431eb3688add16ce1274dab97285f555b72735bf Reviewed-on: https://go-review.googlesource.com/45991 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/sync')
-rw-r--r--src/sync/rwmutex.go3
-rw-r--r--src/sync/rwmutex_test.go3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/sync/rwmutex.go b/src/sync/rwmutex.go
index 94889149a1..cb2dfe1ad8 100644
--- a/src/sync/rwmutex.go
+++ b/src/sync/rwmutex.go
@@ -10,6 +10,9 @@ import (
"unsafe"
)
+// 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.
+
// An RWMutex is a reader/writer mutual exclusion lock.
// 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.
diff --git a/src/sync/rwmutex_test.go b/src/sync/rwmutex_test.go
index 0436f97239..9ee8864ceb 100644
--- a/src/sync/rwmutex_test.go
+++ b/src/sync/rwmutex_test.go
@@ -14,6 +14,9 @@ import (
"testing"
)
+// There is a modified copy of this file in runtime/rwmutex_test.go.
+// If you make any changes here, see if you should make them there.
+
func parallelReader(m *RWMutex, clocked, cunlock, cdone chan bool) {
m.RLock()
clocked <- true