On Thu, Jan 19, 2017 at 7:05 PM, xiaohai dai <seafoo...@gmail.com> wrote:
> I am reading "Data Race Detector"  from Godoc.
> However, I'm confused by the example: Primitive unprotected variable
> displayed in the post. I don't know why this example could lead to data
> race.

The assumption is that there is some other code, not shown, that calls
the KeepAlive method.  Setting the w.last field in KeepAlive races
with reading it in the goroutine started in Start.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to