Duh! Of course! How did I miss that?! Thank's Jan for the explanation and
the rest for your replies!
On Monday, 29 July 2013 10:38:28 UTC-7, Jan Mercl wrote:
On Mon, Jul 29, 2013 at 7:32 PM, Rob Thornton wrote:
Forgive my ignorance but I don't quite understand why the race detector is
saying this is a data race: http://play.golang.org/p/dlTpSSchs3

Doesn't the mutex protect against that?
From a brief peek at your code I think the race is this:

37: m.Write(i)

The value of 'i' is part of the closure and is mutated by the main
gouroutine and read concurrently, but without synchronization by
multiple goroutines.

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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts


Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 6 | next ›
Discussion Overview
groupgolang-nuts @
postedJul 29, '13 at 5:32p
activeJul 30, '13 at 2:57p



site design / logo © 2022 Grokbase