]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
tun: windows: spin for only a millisecond/80
authorJason A. Donenfeld <Jason@zx2c4.com>
Sat, 3 Aug 2019 17:05:53 +0000 (19:05 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sat, 3 Aug 2019 17:11:21 +0000 (19:11 +0200)
Performance stays the same as before.

tun/tun_windows.go

index 30518c691f3270f106b556d565bffaf9a1611bc4..b0faed89736e3fdc96d0df434c10c1812f8827b2 100644 (file)
@@ -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
                }