mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core/bloombis: fix possible data race caused by inconsistent field protection
This commit is contained in:
parent
34bb132b10
commit
cf8078e9d3
1 changed files with 2 additions and 1 deletions
|
|
@ -150,6 +150,7 @@ func (s *scheduler) scheduleDeliveries(pend chan uint64, done chan []byte, quit
|
||||||
// Wait until the request is honoured
|
// Wait until the request is honoured
|
||||||
s.lock.Lock()
|
s.lock.Lock()
|
||||||
res := s.responses[idx]
|
res := s.responses[idx]
|
||||||
|
cached := res.cached
|
||||||
s.lock.Unlock()
|
s.lock.Unlock()
|
||||||
|
|
||||||
select {
|
select {
|
||||||
|
|
@ -161,7 +162,7 @@ func (s *scheduler) scheduleDeliveries(pend chan uint64, done chan []byte, quit
|
||||||
select {
|
select {
|
||||||
case <-quit:
|
case <-quit:
|
||||||
return
|
return
|
||||||
case done <- res.cached:
|
case done <- cached:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue