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

@ -6,7 +6,6 @@ package irc
import (
"fmt"
"net"
"sync/atomic"
"time"
"github.com/ergochat/ergo/irc/caps"
@ -36,11 +35,11 @@ func (server *Server) Languages() (lm *languages.Manager) {
}
func (server *Server) Defcon() uint32 {
return atomic.LoadUint32(&server.defcon)
return server.defcon.Load()
}
func (server *Server) SetDefcon(defcon uint32) {
atomic.StoreUint32(&server.defcon, defcon)
server.defcon.Store(defcon)
}
func (client *Client) Sessions() (sessions []*Session) {