aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/datafmt
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2009-07-07 10:15:01 -0700
committerIan Lance Taylor <iant@golang.org>2009-07-07 10:15:01 -0700
commit5abf395be71e40621d17c6dc5a07aca9ffb5c734 (patch)
treecacc44647d351acffc11539bde28ca0dc745f52c /src/pkg/datafmt
parent27432d67ec4c8b4abe09954349e96745363af31e (diff)
downloadgo-5abf395be71e40621d17c6dc5a07aca9ffb5c734.tar.xz
Avoid race condition. Following the left to right rule,
s.output.Data() was being retrieved before the synchronization point, which meant that it could be retrieved before the goroutine wrote it. Using gccgo this caused random errors. R=gri DELTA=2 (1 added, 0 deleted, 1 changed) OCL=31046 CL=31267
Diffstat (limited to 'src/pkg/datafmt')
-rw-r--r--src/pkg/datafmt/datafmt.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkg/datafmt/datafmt.go b/src/pkg/datafmt/datafmt.go
index 48c24e7264..96dc1d743d 100644
--- a/src/pkg/datafmt/datafmt.go
+++ b/src/pkg/datafmt/datafmt.go
@@ -745,7 +745,8 @@ func (f Format) Eval(env Environment, args ...) ([]byte, os.Error) {
errors <- nil; // no errors
}();
- return s.output.Data(), <- errors;
+ err := <- errors;
+ return s.output.Data(), err;
}