diff options
author | Wolfy-J <[email protected]> | 2019-01-10 11:54:13 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2019-01-10 11:54:13 +0300 |
commit | 926c3f9dab7b0b48ee81308c4cc0eb10d3987a74 (patch) | |
tree | cf68ec6aed25438851136a524b6da5e1c20bc51c /server.go | |
parent | 35bd2c861daf7a3895dc9d99642b53f2107bf5bf (diff) |
do not allow multiple server reconfigure calls at the same time
Diffstat (limited to 'server.go')
-rw-r--r-- | server.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -38,6 +38,7 @@ type Server struct { factory Factory // currently active pool instance + mup sync.Mutex pool Pool // observes pool events (can be attached to multiple pools at the same time) @@ -110,6 +111,9 @@ func (s *Server) Exec(rqs *Payload) (rsp *Payload, err error) { // Reconfigure re-configures underlying pool and destroys it's previous version if any. Reconfigure will ignore factory // and relay settings. func (s *Server) Reconfigure(cfg *ServerConfig) error { + s.mup.Lock() + defer s.mup.Unlock() + s.mu.Lock() if !s.started { s.cfg = cfg |