Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(154)

Issue 3978043: code review 3978043: net: Fix race condition in test. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 2 months ago by iant
Modified:
14 years, 2 months ago
Reviewers:
CC:
adg, r2, rsc, chris_cjones.org, golang-dev
Visibility:
Public.

Description

net: Fix race condition in test. The test code used to do this: for _, tc := range tests { ch <- &tc } Note that &tc is always the same value here. As the value is received from the channel, the sender can loop around and change the contents of tc. This means that the receiver's value is unstable and can change while it is in use.

Patch Set 1 #

Patch Set 2 : code review 3978043: net: Fix race condition in test. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -7 lines) Patch
M src/pkg/net/dnsname_test.go View 3 chunks +7 lines, -7 lines 0 comments Download

Messages

Total messages: 5
iant
Hello adg (cc: golang-dev@googlegroups.com, chris@cjones.org), I'd like you to review this change.
14 years, 2 months ago (2011-01-21 20:47:55 UTC) #1
r2
LGTM
14 years, 2 months ago (2011-01-21 21:45:01 UTC) #2
rsc
LGTM
14 years, 2 months ago (2011-01-21 21:55:44 UTC) #3
iant
*** Submitted as http://code.google.com/p/go/source/detail?r=67b7e16100e3 *** net: Fix race condition in test. The test code used ...
14 years, 2 months ago (2011-01-21 21:57:57 UTC) #4
chris_cjones.org
14 years, 2 months ago (2011-01-22 17:28:25 UTC) #5
LGTM

Thanks for fixing my bug.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b