diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-08-31 19:06:33 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-09-01 21:46:47 -0600 |
commit | 191b0755712977718d291da9f4ad75b31ebff08f (patch) | |
tree | 6072f8cf59f84488ab2af897e35aa4849b513d52 /tunnel | |
parent | build: update resume timer patch to merged version (diff) | |
download | wireguard-windows-191b0755712977718d291da9f4ad75b31ebff08f.tar.xz wireguard-windows-191b0755712977718d291da9f4ad75b31ebff08f.zip |
winipcfg: launch callbacks in goroutines to prevent deadlock
ret:
setupLock
interfaceChangeLock
trigger:
interfaceChangeLock
setupLock
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'tunnel')
-rw-r--r-- | tunnel/winipcfg/interface_change_handler.go | 2 | ||||
-rw-r--r-- | tunnel/winipcfg/route_change_handler.go | 2 | ||||
-rw-r--r-- | tunnel/winipcfg/unicast_address_change_handler.go | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/tunnel/winipcfg/interface_change_handler.go b/tunnel/winipcfg/interface_change_handler.go index 6bb8cf2b..50ea6448 100644 --- a/tunnel/winipcfg/interface_change_handler.go +++ b/tunnel/winipcfg/interface_change_handler.go @@ -66,7 +66,7 @@ func (callback *InterfaceChangeCallback) Unregister() error { func interfaceChanged(callerContext uintptr, row *MibIPInterfaceRow, notificationType MibNotificationType) uintptr { interfaceChangeMutex.Lock() for cb := range interfaceChangeCallbacks { - cb.cb(notificationType, row) + go cb.cb(notificationType, row) } interfaceChangeMutex.Unlock() return 0 diff --git a/tunnel/winipcfg/route_change_handler.go b/tunnel/winipcfg/route_change_handler.go index e43fa3c0..4bdea672 100644 --- a/tunnel/winipcfg/route_change_handler.go +++ b/tunnel/winipcfg/route_change_handler.go @@ -73,7 +73,7 @@ func (callback *RouteChangeCallback) Unregister() error { func routeChanged(callerContext uintptr, row *MibIPforwardRow2, notificationType MibNotificationType) uintptr { routeChangeMutex.Lock() for cb := range routeChangeCallbacks { - cb.cb(notificationType, row) + go cb.cb(notificationType, row) } routeChangeMutex.Unlock() return 0 diff --git a/tunnel/winipcfg/unicast_address_change_handler.go b/tunnel/winipcfg/unicast_address_change_handler.go index b0ae7950..b126e2ed 100644 --- a/tunnel/winipcfg/unicast_address_change_handler.go +++ b/tunnel/winipcfg/unicast_address_change_handler.go @@ -66,7 +66,7 @@ func (callback *UnicastAddressChangeCallback) Unregister() error { func unicastAddressChanged(callerContext uintptr, row *MibUnicastIPAddressRow, notificationType MibNotificationType) uintptr { unicastAddressChangeMutex.Lock() for cb := range unicastAddressChangeCallbacks { - cb.cb(notificationType, row) + go cb.cb(notificationType, row) } unicastAddressChangeMutex.Unlock() return 0 |