mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-06 03:53:47 +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
|
||||
index int // position in s.scheduled
|
||||
s *Simulated
|
||||
do func()
|
||||
run func()
|
||||
ch <-chan AbsTime
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ func (s *Simulated) Run(d time.Duration) {
|
|||
var do []func()
|
||||
for len(s.scheduled) > 0 && s.scheduled[0].at <= end {
|
||||
ev := heap.Pop(&s.scheduled).(*simTimer)
|
||||
do = append(do, ev.do)
|
||||
do = append(do, ev.run)
|
||||
}
|
||||
s.now = end
|
||||
s.mu.Unlock()
|
||||
|
|
@ -135,7 +135,7 @@ func (s *Simulated) schedule(d time.Duration, fn func()) *simTimer {
|
|||
s.init()
|
||||
|
||||
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)
|
||||
s.cond.Broadcast()
|
||||
return ev
|
||||
|
|
|
|||
Loading…
Reference in a new issue