diff options
Diffstat (limited to 'libgo/go/runtime/time.go')
-rw-r--r-- | libgo/go/runtime/time.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libgo/go/runtime/time.go b/libgo/go/runtime/time.go index 65a1ae00196..a69db993c9d 100644 --- a/libgo/go/runtime/time.go +++ b/libgo/go/runtime/time.go @@ -608,8 +608,14 @@ func moveTimers(pp *p, timers []*timer) { for { switch s := atomic.Load(&t.status); s { case timerWaiting: + if !atomic.Cas(&t.status, s, timerMoving) { + continue + } t.pp = 0 doaddtimer(pp, t) + if !atomic.Cas(&t.status, timerMoving, timerWaiting) { + badTimer() + } break loop case timerModifiedEarlier, timerModifiedLater: if !atomic.Cas(&t.status, s, timerMoving) { |