From 2b6f0d61e56de5436d7b964e3f667b76d34adb0f Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Tue, 13 Jan 2015 08:12:02 +0000 Subject: [PATCH] When locking *do* unlock Add unlocking to some more places as pointed out by bronze1man. Really closes #161. --- server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server.go b/server.go index f49c0d77..707305e6 100644 --- a/server.go +++ b/server.go @@ -287,6 +287,7 @@ func (srv *Server) ListenAndServe() error { func (srv *Server) ActivateAndServe() error { srv.lock.Lock() if srv.started { + srv.lock.Unlock() return &Error{err: "server already started"} } srv.stopUDP, srv.stopTCP = make(chan bool), make(chan bool) @@ -318,6 +319,7 @@ func (srv *Server) ActivateAndServe() error { func (srv *Server) Shutdown() error { srv.lock.Lock() if !srv.started { + srv.lock.Unlock() return &Error{err: "server not started"} } srv.started = false