summaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-01-10 12:02:46 +0300
committerGitHub <[email protected]>2019-01-10 12:02:46 +0300
commit5b24b65e62a26f74b9f9bd9ee79c717ea0836892 (patch)
treef492599f11279b3f062a86dc72fb162652b2e6d6 /server.go
parentd5de11540b21c4df22690a233980ae1a16aaf344 (diff)
parent926c3f9dab7b0b48ee81308c4cc0eb10d3987a74 (diff)
Merge pull request #86 from spiral/qol
Qol
Diffstat (limited to 'server.go')
-rw-r--r--server.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/server.go b/server.go
index 25ce7945..26f58172 100644
--- a/server.go
+++ b/server.go
@@ -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