aboutsummaryrefslogtreecommitdiff
path: root/doc/go_mem.html
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-05-16 17:03:51 -0400
committerRuss Cox <rsc@golang.org>2011-05-16 17:03:51 -0400
commit9f03d4a3f7cb5df43fdac3d726e495ae2ee4f7e4 (patch)
tree9b864e236f740d7dbdc9c3aeeb3e84c47fabbfba /doc/go_mem.html
parent2ddcad96d78fc70bb6886d82af8de7c74707c991 (diff)
downloadgo-9f03d4a3f7cb5df43fdac3d726e495ae2ee4f7e4.tar.gz
go-9f03d4a3f7cb5df43fdac3d726e495ae2ee4f7e4.zip
doc/go_mem.html: close happens before receive on closed channel
R=golang-dev, gri CC=golang-dev https://golang.org/cl/4551042
Diffstat (limited to 'doc/go_mem.html')
-rw-r--r--doc/go_mem.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/go_mem.html b/doc/go_mem.html
index da45a07d7a..906b858e88 100644
--- a/doc/go_mem.html
+++ b/doc/go_mem.html
@@ -1,5 +1,14 @@
<!-- The Go Memory Model -->
+<style>
+p.rule {
+ font-style: italic;
+}
+span.event {
+ font-style: italic;
+}
+</style>
+
<h2>Introduction</h2>
<p>
@@ -214,6 +223,17 @@ the <code>print</code>.
</p>
<p class="rule">
+The closing of a channel happens before a receive that returns a zero value
+because the channel is closed.
+</p>
+
+<p>
+In the previous example, replacing
+<code>c &lt;- 0</code> with <code>close(c)</code>
+yields a program with the same guaranteed behavior.
+</p>
+
+<p class="rule">
A receive from an unbuffered channel happens before
the send on that channel completes.
</p>