mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
genericize atomic config changes
This commit is contained in:
parent
66bf6244f3
commit
c603d41d08
3 changed files with 35 additions and 9 deletions
|
|
@ -7,7 +7,6 @@ import (
|
|||
"net"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/ergochat/ergo/irc/caps"
|
||||
"github.com/ergochat/ergo/irc/languages"
|
||||
|
|
@ -16,11 +15,7 @@ import (
|
|||
)
|
||||
|
||||
func (server *Server) Config() (config *Config) {
|
||||
return (*Config)(atomic.LoadPointer(&server.config))
|
||||
}
|
||||
|
||||
func (server *Server) SetConfig(config *Config) {
|
||||
atomic.StorePointer(&server.config, unsafe.Pointer(config))
|
||||
return server.config.Get()
|
||||
}
|
||||
|
||||
func (server *Server) ChannelRegistrationEnabled() bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue