]> Cypherpunks repositories - gostls13.git/commitdiff
go_mem: clarified unbuffered channel sync example
authorAndrew Gerrand <adg@golang.org>
Tue, 23 Feb 2010 00:51:28 +0000 (16:51 -0800)
committerAndrew Gerrand <adg@golang.org>
Tue, 23 Feb 2010 00:51:28 +0000 (16:51 -0800)
R=rsc
CC=golang-dev
https://golang.org/cl/218063

doc/go_mem.html

index ede79720a656d3f306c117eefbc711e0bd0fd086..4772bc2178b90afbf4985e919b4de08bcabad9fe 100644 (file)
@@ -190,7 +190,8 @@ the send on that channel completes.
 </p>
 
 <p>
-This program:
+This program (as above, but with the send and receive statements swapped and
+using an unbuffered channel):
 </p>
 
 <pre>
@@ -222,7 +223,7 @@ before the <code>print</code>.
 If the channel were buffered (e.g., <code>c = make(chan int, 1)</code>)
 then the program would not be guaranteed to print
 <code>"hello, world"</code>.  (It might print the empty string;
-it cannot print <code>"hello, sailor"</code>, nor can it crash.)
+it cannot print <code>"goodbye, universe"</code>, nor can it crash.)
 </p>
 
 <h3>Locks</h3>