aboutsummaryrefslogtreecommitdiff
path: root/src/sync/waitgroup.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/sync/waitgroup.go')
-rw-r--r--src/sync/waitgroup.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sync/waitgroup.go b/src/sync/waitgroup.go
index 029e6077cd..b386e1fec2 100644
--- a/src/sync/waitgroup.go
+++ b/src/sync/waitgroup.go
@@ -15,7 +15,11 @@ import (
// goroutines to wait for. Then each of the goroutines
// runs and calls Done when finished. At the same time,
// Wait can be used to block until all goroutines have finished.
+//
+// A WaitGroup must not be copied after first use.
type WaitGroup struct {
+ noCopy noCopy
+
// 64-bit value: high 32 bits are counter, low 32 bits are waiter count.
// 64-bit atomic operations require 64-bit alignment, but 32-bit
// compilers do not ensure it. So we allocate 12 bytes and then use