1
0
mirror of https://github.com/golang/go synced 2024-11-21 16:34:42 -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> <p>
If the channel were buffered (e.g., <code>c = make(chan int, 1)</code>) If the channel were buffered (e.g., <code>c = make(chan int, 1)</code>)
then the program would not be guaranteed to print then the program would not be guaranteed to print
<code>"hello, world"</code>. (It might print the empty string; <code>"hello, world"</code>. (It might print the empty string,
it cannot print <code>"goodbye, universe"</code>, nor can it crash.) crash, or do something else.)
</p> </p>
<h3>Locks</h3> <h3>Locks</h3>