Style
This commit is contained in:
parent
711f929879
commit
52d797ce1a
|
@ -14,7 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
DeviceRoutineNumberPerCPU = 3
|
DeviceRoutineNumberPerCPU = 3
|
||||||
DeviceRoutineNumberAdditional = 2
|
DeviceRoutineNumberAdditional = 2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -301,8 +301,8 @@ func NewDevice(tun TUNDevice, logger *Logger) *Device {
|
||||||
cpus := runtime.NumCPU()
|
cpus := runtime.NumCPU()
|
||||||
device.state.starting.Wait()
|
device.state.starting.Wait()
|
||||||
device.state.stopping.Wait()
|
device.state.stopping.Wait()
|
||||||
device.state.stopping.Add(DeviceRoutineNumberPerCPU * cpus + DeviceRoutineNumberAdditional)
|
device.state.stopping.Add(DeviceRoutineNumberPerCPU*cpus + DeviceRoutineNumberAdditional)
|
||||||
device.state.starting.Add(DeviceRoutineNumberPerCPU * cpus + DeviceRoutineNumberAdditional)
|
device.state.starting.Add(DeviceRoutineNumberPerCPU*cpus + DeviceRoutineNumberAdditional)
|
||||||
for i := 0; i < cpus; i += 1 {
|
for i := 0; i < cpus; i += 1 {
|
||||||
go device.RoutineEncryption()
|
go device.RoutineEncryption()
|
||||||
go device.RoutineDecryption()
|
go device.RoutineDecryption()
|
||||||
|
|
Loading…
Reference in a new issue