common/mclock: rename symbol to remove conflicts with other languages (#35460)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run

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:
Guillaume Ballet 2026-08-04 14:04:26 +02:00 committed by GitHub
parent 1e0679c7e2
commit e25efd2c62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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