mirror of
https://github.com/golang/go
synced 2024-11-17 15:04:45 -07:00
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 <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
parent
e2dc6dd5c9
commit
77aa209b38
@ -118,10 +118,15 @@ func sigNoteWakeup(*note) {
|
||||
|
||||
// sigNoteSleep waits for a note created by sigNoteSetup to be woken.
|
||||
func sigNoteSleep(*note) {
|
||||
entersyscallblock()
|
||||
for {
|
||||
var b byte
|
||||
read(sigNoteRead, unsafe.Pointer(&b), 1)
|
||||
entersyscallblock()
|
||||
n := read(sigNoteRead, unsafe.Pointer(&b), 1)
|
||||
exitsyscall()
|
||||
if n != -_EINTR {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// BSD interface for threading.
|
||||
|
Loading…
Reference in New Issue
Block a user