mirror of
https://github.com/golang/go
synced 2024-09-04 15:34:21 +00:00
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
This commit is contained in:
parent
27432d67ec
commit
5abf395be7
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue