1
0
mirror of https://github.com/golang/go synced 2024-11-21 12:54:45 -07:00

doc: Don't imply incorrect guarantees about data races.

A race between
        a = "hello, world"
and
        print(a)
is not guaranteed to print either "hello, world" or "".
Its behaviour is undefined.

Fixes #4039.

R=rsc
CC=dvyukov, gobot, golang-dev, r
https://golang.org/cl/6489075
This commit is contained in:
David Symonds 2012-09-11 08:47:30 +10:00
parent 6c4645cffe
commit aecf5033df

View File

@ -270,8 +270,8 @@ before the <code>print</code>.
<p>
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>"goodbye, universe"</code>, nor can it crash.)
<code>"hello, world"</code>. (It might print the empty string,
crash, or do something else.)
</p>
<h3>Locks</h3>