Skip to content

Commit dff9108

Browse files
committed
runtime: make notetsleep_internal nowritebarrier
When notetsleep_internal is called from notetsleepg, notetsleepg has just given up the P, so write barriers are not allowed in notetsleep_internal. Change-Id: I1b214fa388b1ea05b8ce2dcfe1c0074c0a3c8870 Reviewed-on: https://go-review.googlesource.com/12647 Reviewed-by: Rick Hudson <[email protected]> Reviewed-by: Russ Cox <[email protected]>
1 parent cf225a1 commit dff9108

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/runtime/lock_futex.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ func notesleep(n *note) {
144144
}
145145
}
146146

147+
// May run with m.p==nil if called from notetsleep, so write barriers
148+
// are not allowed.
149+
//
147150
//go:nosplit
151+
//go:nowritebarrier
148152
func notetsleep_internal(n *note, ns int64) bool {
149153
gp := getg()
150154

0 commit comments

Comments
 (0)