From: Russ Cox Date: Mon, 16 May 2011 21:03:51 +0000 (-0400) Subject: doc/go_mem.html: close happens before receive on closed channel X-Git-Tag: weekly.2011-05-22~53 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9f03d4a3f7cb5df43fdac3d726e495ae2ee4f7e4;p=gostls13.git doc/go_mem.html: close happens before receive on closed channel R=golang-dev, gri CC=golang-dev https://golang.org/cl/4551042 --- 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 @@ + +

Introduction

@@ -213,6 +222,17 @@ the corresponding receive on c completes, which happens before the print.

+

+The closing of a channel happens before a receive that returns a zero value +because the channel is closed. +

+ +

+In the previous example, replacing +c <- 0 with close(c) +yields a program with the same guaranteed behavior. +

+

A receive from an unbuffered channel happens before the send on that channel completes.