server: properly set stopping atomic var upon shutdown
This commit is contained in:
1 file changed
+1
-1
@@ -1298,7 +1298,7 @@ func (s *server) Start() error {
|
|||||||
// NOTE: This function is safe for concurrent access.
|
// NOTE: This function is safe for concurrent access.
|
||||||
func (s *server) Stop() error {
|
func (s *server) Stop() error {
|
||||||
s.stop.Do(func() {
|
s.stop.Do(func() {
|
||||||
atomic.LoadInt32(&s.stopping)
|
atomic.StoreInt32(&s.stopping, 1)
|
||||||
|
|
||||||
close(s.quit)
|
close(s.quit)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user