Skip to content

Commit 77aa209

Browse files
runtime: loop on EINTR in macOS sigNoteSleep
Fixes #46466 Change-Id: I8fb15d0c8ef7ef6e6fc1b9e0e033d213255fe0df Reviewed-on: https://go-review.googlesource.com/c/go/+/326778 Trust: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
1 parent e2dc6dd commit 77aa209

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/runtime/os_darwin.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,15 @@ func sigNoteWakeup(*note) {
118118

119119
// sigNoteSleep waits for a note created by sigNoteSetup to be woken.
120120
func sigNoteSleep(*note) {
121-
entersyscallblock()
122-
var b byte
123-
read(sigNoteRead, unsafe.Pointer(&b), 1)
124-
exitsyscall()
121+
for {
122+
var b byte
123+
entersyscallblock()
124+
n := read(sigNoteRead, unsafe.Pointer(&b), 1)
125+
exitsyscall()
126+
if n != -_EINTR {
127+
return
128+
}
129+
}
125130
}
126131

127132
// BSD interface for threading.

0 commit comments

Comments
 (0)