From: Jason A. Donenfeld Date: Sat, 3 Aug 2019 17:05:53 +0000 (+0200) Subject: tun: windows: spin for only a millisecond/80 X-Git-Tag: 0.0.20190805~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4010123f74470eeca0551a151dea3e7a7381bcc;p=thirdparty%2Fwireguard-go.git tun: windows: spin for only a millisecond/80 Performance stays the same as before. --- 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 }