summaryrefslogtreecommitdiff
path: root/src/sync/map.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/sync/map.go')
-rw-r--r--src/sync/map.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sync/map.go b/src/sync/map.go
index 2fa3253429..ec529e056b 100644
--- a/src/sync/map.go
+++ b/src/sync/map.go
@@ -24,6 +24,13 @@ import (
// contention compared to a Go map paired with a separate Mutex or RWMutex.
//
// The zero Map is empty and ready for use. A Map must not be copied after first use.
+//
+// In the terminology of the Go memory model, Map arranges that a write operation
+// “synchronizes before” any read operation that observes the effect of the write, where
+// read and write operations are defined as follows.
+// Load, LoadAndDelete, LoadOrStore are read operations;
+// Delete, LoadAndDelete, and Store are write operations;
+// and LoadOrStore is a write operation when it returns loaded set to false.
type Map struct {
mu Mutex