]> Cypherpunks repositories - gostls13.git/commit
expvar: sort maps, fix race
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 20 Jan 2014 17:59:23 +0000 (09:59 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 20 Jan 2014 17:59:23 +0000 (09:59 -0800)
commitcfb9cf0f0679b07583b8667487c516b1f77f2292
tree1a9d5aaec049e703726c826b2c68bf0c8faf3f34
parent6592aeb8f3a0398f32a31642695188b361c6c434
expvar: sort maps, fix race

It's pretty distracting to use expvar with the output of both
the top-level map and map values jumping around randomly.

Also fixes a potential race where multiple clients trying to
increment a map int or float key at the same time could lose
updates.

R=golang-codereviews, couchmoney
CC=golang-codereviews
https://golang.org/cl/54320043
src/pkg/expvar/expvar.go
src/pkg/expvar/expvar_test.go