Pull request 1806: 5661-fix-protection-update-lock
Updates #5661. Squashed commit of the following: commit 02e83c75c8f44f084c0cb8d33b7d6a524c8c1b0e Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Apr 6 19:28:17 2023 +0300 dnsforward: imp logs commit 0f27265fc94f0e3b8e2dee79dbf9ab5344416c61 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Apr 6 19:18:19 2023 +0300 dnsforward: imp locks
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/AdguardTeam/AdGuardHome/internal/aghalg"
|
||||
@@ -111,6 +112,10 @@ type Server struct {
|
||||
|
||||
isRunning bool
|
||||
|
||||
// protectionUpdateInProgress is used to make sure that only one goroutine
|
||||
// updating the protection configuration after a pause is running at a time.
|
||||
protectionUpdateInProgress atomic.Bool
|
||||
|
||||
conf ServerConfig
|
||||
// serverLock protects Server.
|
||||
serverLock sync.RWMutex
|
||||
|
||||
Reference in New Issue
Block a user