mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-12 23:13:45 +00:00
common/mclock: rename symbol to remove conflicts with other languages (#35460)
Calling a function `do` is fine in go, but when interacting with other languages, namely C, this clashes with a known keyword, which some compilers don't like.
This commit is contained in:
parent
1e0679c7e2
commit
e25efd2c62
1 changed files with 3 additions and 3 deletions
|
|
@ -43,7 +43,7 @@ type simTimer struct {
|
||||||
at AbsTime
|
at AbsTime
|
||||||
index int // position in s.scheduled
|
index int // position in s.scheduled
|
||||||
s *Simulated
|
s *Simulated
|
||||||
do func()
|
run func()
|
||||||
ch <-chan AbsTime
|
ch <-chan AbsTime
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@ func (s *Simulated) Run(d time.Duration) {
|
||||||
var do []func()
|
var do []func()
|
||||||
for len(s.scheduled) > 0 && s.scheduled[0].at <= end {
|
for len(s.scheduled) > 0 && s.scheduled[0].at <= end {
|
||||||
ev := heap.Pop(&s.scheduled).(*simTimer)
|
ev := heap.Pop(&s.scheduled).(*simTimer)
|
||||||
do = append(do, ev.do)
|
do = append(do, ev.run)
|
||||||
}
|
}
|
||||||
s.now = end
|
s.now = end
|
||||||
s.mu.Unlock()
|
s.mu.Unlock()
|
||||||
|
|
@ -135,7 +135,7 @@ func (s *Simulated) schedule(d time.Duration, fn func()) *simTimer {
|
||||||
s.init()
|
s.init()
|
||||||
|
|
||||||
at := s.now.Add(d)
|
at := s.now.Add(d)
|
||||||
ev := &simTimer{do: fn, at: at, s: s}
|
ev := &simTimer{run: fn, at: at, s: s}
|
||||||
heap.Push(&s.scheduled, ev)
|
heap.Push(&s.scheduled, ev)
|
||||||
s.cond.Broadcast()
|
s.cond.Broadcast()
|
||||||
return ev
|
return ev
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue