aboutsummaryrefslogtreecommitdiffstats
path: root/device.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--device.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/device.go b/device.go
index c714b21..e127b5b 100644
--- a/device.go
+++ b/device.go
@@ -74,8 +74,8 @@ type Device struct {
handshake chan QueueHandshakeElement
}
- signal struct {
- stop Signal
+ signals struct {
+ stop chan struct{}
}
tun struct {
@@ -302,7 +302,7 @@ func NewDevice(tun TUNDevice, logger *Logger) *Device {
// prepare signals
- device.signal.stop = NewSignal()
+ device.signals.stop = make(chan struct{}, 1)
// prepare net
@@ -400,7 +400,7 @@ func (device *Device) Close() {
device.isUp.Set(false)
- device.signal.stop.Broadcast()
+ close(device.signals.stop)
device.state.stopping.Wait()
device.FlushPacketQueues()
@@ -413,5 +413,5 @@ func (device *Device) Close() {
}
func (device *Device) Wait() chan struct{} {
- return device.signal.stop.Wait()
+ return device.signals.stop
}