aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/sync/once.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/sync/once.go')
-rw-r--r--libgo/go/sync/once.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/libgo/go/sync/once.go b/libgo/go/sync/once.go
index ca04408..8844314 100644
--- a/libgo/go/sync/once.go
+++ b/libgo/go/sync/once.go
@@ -9,11 +9,13 @@ import (
)
// Once is an object that will perform exactly one action.
+//
+// A Once must not be copied after first use.
type Once struct {
// done indicates whether the action has been performed.
// It is first in the struct because it is used in the hot path.
// The hot path is inlined at every call site.
- // Placing done first allows more compact instructions on some architectures (amd64/x86),
+ // Placing done first allows more compact instructions on some architectures (amd64/386),
// and fewer instructions (to calculate offset) on other architectures.
done uint32
m Mutex