diff options
| author | Dmitriy Vyukov <dvyukov@google.com> | 2013-06-10 22:58:04 +0400 |
|---|---|---|
| committer | Dmitriy Vyukov <dvyukov@google.com> | 2013-06-10 22:58:04 +0400 |
| commit | 62747bde6c72ea6335a28daaf148a970b991987b (patch) | |
| tree | eacd6e0dfb64a985bf398c80f353d25ffe5b6d34 /src/pkg/runtime/chan.c | |
| parent | 06f55f50097293027a4634ba88140c75702c6a5d (diff) | |
| download | go-62747bde6c72ea6335a28daaf148a970b991987b.tar.xz | |
runtime: catch races between channel close and channel send in select
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/10137043
Diffstat (limited to 'src/pkg/runtime/chan.c')
| -rw-r--r-- | src/pkg/runtime/chan.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkg/runtime/chan.c b/src/pkg/runtime/chan.c index 403a72dc8a..6aa9bd40e1 100644 --- a/src/pkg/runtime/chan.c +++ b/src/pkg/runtime/chan.c @@ -186,7 +186,6 @@ runtime·chansend(ChanType *t, Hchan *c, byte *ep, bool *pres, void *pc) } runtime·lock(c); - // TODO(dvyukov): add similar instrumentation to select. if(raceenabled) runtime·racereadpc(c, pc, runtime·chansend); if(c->closed) @@ -946,6 +945,8 @@ loop: break; case CaseSend: + if(raceenabled) + runtime·racereadpc(c, cas->pc, runtime·chansend); if(c->closed) goto sclose; if(c->dataqsiz > 0) { |
