1
0
Fork 0
forked from External/ergo

use new aligned atomic types everywhere

See 69448b13a1 / #1969; the compiler can now ensure that a uint64
intended for atomic access is always aligned to a 64-bit boundary.
Convert atomic operations on uint32s and pointers as well.
This commit is contained in:
Shivaram Lingamneni 2022-08-10 02:47:39 -04:00
parent 507dc2d838
commit 35128bfc23
6 changed files with 25 additions and 27 deletions

View file

@ -91,7 +91,7 @@ type Server struct {
stats Stats
semaphores ServerSemaphores
flock flock.Flocker
defcon uint32
defcon atomic.Uint32
}
// NewServer returns a new Oragono server.
@ -103,8 +103,8 @@ func NewServer(config *Config, logger *logger.Manager) (*Server, error) {
logger: logger,
rehashSignal: make(chan os.Signal, 1),
exitSignals: make(chan os.Signal, len(utils.ServerExitSignals)),
defcon: 5,
}
server.defcon.Store(5)
server.accepts.Initialize()
server.clients.Initialize()