Work on portmaster restructuring
This commit is contained in:
@@ -5,41 +5,41 @@ import "sync/atomic"
|
||||
// SetCurrentSecurityLevel sets the current security level.
|
||||
func SetCurrentSecurityLevel(level uint8) {
|
||||
sysStatusLock.Lock()
|
||||
defer sysStatusLock.Unlock()
|
||||
sysStatus.CurrentSecurityLevel = level
|
||||
atomicUpdateCurrentSecurityLevel(level)
|
||||
defer sysStatusLock.Unlock()
|
||||
sysStatus.CurrentSecurityLevel = level
|
||||
atomicUpdateCurrentSecurityLevel(level)
|
||||
}
|
||||
|
||||
// SetSelectedSecurityLevel sets the selected security level.
|
||||
func SetSelectedSecurityLevel(level uint8) {
|
||||
sysStatusLock.Lock()
|
||||
defer sysStatusLock.Unlock()
|
||||
sysStatus.SelectedSecurityLevel = level
|
||||
atomicUpdateSelectedSecurityLevel(level)
|
||||
defer sysStatusLock.Unlock()
|
||||
sysStatus.SelectedSecurityLevel = level
|
||||
atomicUpdateSelectedSecurityLevel(level)
|
||||
}
|
||||
|
||||
// SetThreatLevel sets the current threat level.
|
||||
func SetThreatLevel(level uint8) {
|
||||
sysStatusLock.Lock()
|
||||
defer sysStatusLock.Unlock()
|
||||
sysStatus.ThreatLevel = level
|
||||
atomicUpdateThreatLevel(level)
|
||||
defer sysStatusLock.Unlock()
|
||||
sysStatus.ThreatLevel = level
|
||||
atomicUpdateThreatLevel(level)
|
||||
}
|
||||
|
||||
// SetPortmasterStatus sets the current Portmaster status.
|
||||
func SetPortmasterStatus(status uint8) {
|
||||
sysStatusLock.Lock()
|
||||
defer sysStatusLock.Unlock()
|
||||
sysStatus.PortmasterStatus = status
|
||||
atomicUpdatePortmasterStatus(status)
|
||||
defer sysStatusLock.Unlock()
|
||||
sysStatus.PortmasterStatus = status
|
||||
atomicUpdatePortmasterStatus(status)
|
||||
}
|
||||
|
||||
// SetGate17Status sets the current Gate17 status.
|
||||
func SetGate17Status(status uint8) {
|
||||
sysStatusLock.Lock()
|
||||
defer sysStatusLock.Unlock()
|
||||
sysStatus.Gate17Status = status
|
||||
atomicUpdateGate17Status(status)
|
||||
defer sysStatusLock.Unlock()
|
||||
sysStatus.Gate17Status = status
|
||||
atomicUpdateGate17Status(status)
|
||||
}
|
||||
|
||||
// update functions for atomic stuff
|
||||
|
||||
Reference in New Issue
Block a user