From b6ad32b183ec981568c6b937ddf6315418941dfe Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Mon, 20 Sep 2010 07:37:41 +1000 Subject: [PATCH] doc/go_mem.html: update location of "once". Fixes #1118. R=rsc CC=golang-dev https://golang.org/cl/2225044 --- doc/go_mem.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/go_mem.html b/doc/go_mem.html index 33bce5f7a6..78238900dd 100644 --- a/doc/go_mem.html +++ b/doc/go_mem.html @@ -276,8 +276,9 @@ before the n+1'th call to l.Lock.

Once

-The once package provides a safe mechanism for -initialization in the presence of multiple goroutines. +The sync package provides a safe mechanism for +initialization in the presence of multiple goroutines +through the use of the Once type. Multiple threads can execute once.Do(f) for a particular f, but only one will run f(), and the other calls block until f() has returned. @@ -293,6 +294,7 @@ In this program:

 var a string
+var once sync.Once
 
 func setup() {
 	a = "hello, world"
-- 
2.50.0