Fix data races added in 161fc061d3

Change-Id: I7167472de3778fc76cc54dff6c864ed43b2052e9
This commit is contained in:
Brad Fitzpatrick 2013-10-10 19:54:23 -10:00
parent b169d80589
commit 6e92302b1d
4 changed files with 4 additions and 0 deletions

View File

@ -236,6 +236,7 @@ func (s *storage) StatBlobs(dest chan<- blob.SizedRef, blobs []blob.Ref) (err er
var wg syncutil.Group var wg syncutil.Group
for _, br := range blobs { for _, br := range blobs {
br := br
statGate.Start() statGate.Start()
wg.Go(func() error { wg.Go(func() error {
defer statGate.Done() defer statGate.Done()

View File

@ -50,6 +50,7 @@ func (ds *DiskStorage) StatBlobs(dest chan<- blob.SizedRef, blobs []blob.Ref) er
var wg syncutil.Group var wg syncutil.Group
for _, ref := range blobs { for _, ref := range blobs {
ref := ref
statGate.Start() statGate.Start()
wg.Go(func() error { wg.Go(func() error {
defer statGate.Done() defer statGate.Done()

View File

@ -27,6 +27,7 @@ func (sto *s3Storage) RemoveBlobs(blobs []blob.Ref) error {
var wg syncutil.Group var wg syncutil.Group
for _, blob := range blobs { for _, blob := range blobs {
blob := blob
removeGate.Start() removeGate.Start()
wg.Go(func() error { wg.Go(func() error {
defer removeGate.Done() defer removeGate.Done()

View File

@ -30,6 +30,7 @@ func (sto *s3Storage) StatBlobs(dest chan<- blob.SizedRef, blobs []blob.Ref) err
var wg syncutil.Group var wg syncutil.Group
for _, br := range blobs { for _, br := range blobs {
br := br
statGate.Start() statGate.Start()
wg.Go(func() error { wg.Go(func() error {
defer statGate.Done() defer statGate.Done()