Skip to content

Commit 0ee1fb6

Browse files
committed
time: make runtimeTimer.status atomic.Uint32 to sync with runtime.timer
Fixes #64549
1 parent 098f059 commit 0ee1fb6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/time/sleep.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
package time
66

7+
import "sync/atomic"
8+
79
// Sleep pauses the current goroutine for at least the duration d.
810
// A negative or zero duration causes Sleep to return immediately.
911
func Sleep(d Duration)
@@ -18,7 +20,7 @@ type runtimeTimer struct {
1820
arg any
1921
seq uintptr
2022
nextwhen int64
21-
status uint32
23+
status atomic.Uint32
2224
}
2325

2426
// when is a helper function for setting the 'when' field of a runtimeTimer.

0 commit comments

Comments
 (0)