Finer-grained start-stop synchronization
This commit is contained in:
parent
23eca94508
commit
846d721dfd
6 changed files with 33 additions and 5 deletions
4
tun.go
4
tun.go
|
|
@ -35,6 +35,8 @@ func (device *Device) RoutineTUNEventReader() {
|
|||
logInfo := device.log.Info
|
||||
logError := device.log.Error
|
||||
|
||||
device.state.starting.Done()
|
||||
|
||||
for event := range device.tun.device.Events() {
|
||||
if event&TUNEventMTUUpdate != 0 {
|
||||
mtu, err := device.tun.device.MTU()
|
||||
|
|
@ -63,4 +65,6 @@ func (device *Device) RoutineTUNEventReader() {
|
|||
device.Down()
|
||||
}
|
||||
}
|
||||
|
||||
device.state.stopping.Done()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue