]> Cypherpunks repositories - gostls13.git/commit
runtime: support channel-based mutex in race detector
authorDmitriy Vyukov <dvyukov@google.com>
Wed, 26 Mar 2014 15:05:48 +0000 (19:05 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Wed, 26 Mar 2014 15:05:48 +0000 (19:05 +0400)
commitd89a73837878fa16697e98ff1adf249eef5eaa05
tree23a2cf338e630ed717cff37e32d6af81337c4ed0
parentf8c350873c94baaf53b9c1c2b6ddfb463172c3de
runtime: support channel-based mutex in race detector
Update channel race annotations to support change in
cl/75130045: doc: allow buffered channel as semaphore without initialization
The new annotations are added only for channels with capacity 1.
Strictly saying it's possible to construct a counter-example that
will produce a false positive with capacity > 1. But it's hardly can
lead to false positives in real programs, at least I would like to see such programs first.
Any additional annotations also increase probability of false negatives,
so I would prefer to add them lazily.

LGTM=rsc
R=golang-codereviews
CC=golang-codereviews, iant, khr, rsc
https://golang.org/cl/76970043
src/pkg/runtime/chan.goc
src/pkg/runtime/race/testdata/chan_test.go