mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00: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
1 changed files with 9 additions and 4 deletions
|
|
@ -118,10 +118,15 @@ func sigNoteWakeup(*note) {
|
||||||
|
|
||||||
// sigNoteSleep waits for a note created by sigNoteSetup to be woken.
|
// sigNoteSleep waits for a note created by sigNoteSetup to be woken.
|
||||||
func sigNoteSleep(*note) {
|
func sigNoteSleep(*note) {
|
||||||
entersyscallblock()
|
for {
|
||||||
var b byte
|
var b byte
|
||||||
read(sigNoteRead, unsafe.Pointer(&b), 1)
|
entersyscallblock()
|
||||||
|
n := read(sigNoteRead, unsafe.Pointer(&b), 1)
|
||||||
exitsyscall()
|
exitsyscall()
|
||||||
|
if n != -_EINTR {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// BSD interface for threading.
|
// BSD interface for threading.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue