From: Rob Pike Date: Sun, 19 Sep 2010 21:37:41 +0000 (+1000) Subject: doc/go_mem.html: update location of "once". X-Git-Tag: weekly.2010-09-22~43 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b6ad32b183ec981568c6b937ddf6315418941dfe;p=gostls13.git doc/go_mem.html: update location of "once". Fixes #1118. R=rsc CC=golang-dev https://golang.org/cl/2225044 --- 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"