aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/runtime/netpoll_stub.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/netpoll_stub.go b/src/runtime/netpoll_stub.go
index f86f2f6174..3599f2d01b 100644
--- a/src/runtime/netpoll_stub.go
+++ b/src/runtime/netpoll_stub.go
@@ -49,6 +49,9 @@ func netpoll(delay int64) gList {
notetsleep(&netpollNote, delay)
unlock(&netpollStubLock)
+ // Guard against starvation in case the lock is contended
+ // (eg when running TestNetpollBreak).
+ osyield()
}
return gList{}
}