mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
beacon/light/request: nicer trigger wait loop
Co-authored-by: Martin HS <martin@swende.se>
This commit is contained in:
parent
eceba4c6f7
commit
7fa0a003d3
1 changed files with 8 additions and 10 deletions
|
|
@ -203,19 +203,17 @@ func (s *Scheduler) syncLoop() {
|
||||||
s.lock.Lock()
|
s.lock.Lock()
|
||||||
s.processRound()
|
s.processRound()
|
||||||
s.lock.Unlock()
|
s.lock.Unlock()
|
||||||
loop:
|
for triggered := false; !triggered; {
|
||||||
for {
|
|
||||||
select {
|
select {
|
||||||
case stop := <-s.stopCh:
|
case stop := <-s.stopCh:
|
||||||
close(stop)
|
close(stop)
|
||||||
return
|
return
|
||||||
case <-s.triggerCh:
|
case <-s.triggerCh:
|
||||||
break loop
|
triggered = true
|
||||||
case <-s.testWaitCh:
|
case <-s.testWaitCh:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// targetChanged returns true if a registered target data structure has been
|
// targetChanged returns true if a registered target data structure has been
|
||||||
// changed since the last call to this function.
|
// changed since the last call to this function.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue