aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-08-03 19:05:53 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-08-03 19:11:21 +0200
commitb4010123f74470eeca0551a151dea3e7a7381bcc (patch)
treed65f94a30c224e8c6bd11340f0a361b76112bcc3
parentwintun: merge opening device registry key (diff)
downloadwireguard-go-b4010123f74470eeca0551a151dea3e7a7381bcc.tar.xz
wireguard-go-b4010123f74470eeca0551a151dea3e7a7381bcc.zip
tun: windows: spin for only a millisecond/80
Performance stays the same as before.
-rw-r--r--tun/tun_windows.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/tun/tun_windows.go b/tun/tun_windows.go
index 30518c6..b0faed8 100644
--- a/tun/tun_windows.go
+++ b/tun/tun_windows.go
@@ -215,7 +215,7 @@ retry:
if tun.close {
return 0, os.ErrClosed
}
- if time.Since(start) >= time.Millisecond*50 {
+ if time.Since(start) >= time.Millisecond/80 /* ~1gbit/s */ {
windows.WaitForSingleObject(tun.rings.send.tailMoved, windows.INFINITE)
goto retry
}