Lock started flag when changing it.

This commit is contained in:
Milos Gajdos 2019-08-23 15:07:08 +01:00
parent 80dc0b97a9
commit ba99f037fb
No known key found for this signature in database
GPG Key ID: 8B31058CC55DFD4F
2 changed files with 4 additions and 0 deletions

View File

@ -815,7 +815,9 @@ func (g *grpcServer) Stop() error {
var err error
select {
case err = <-ch:
g.Lock()
g.started = false
g.Unlock()
}
return err

View File

@ -739,7 +739,9 @@ func (s *rpcServer) Stop() error {
var err error
select {
case err = <-ch:
s.Lock()
s.started = false
s.Unlock()
}
return err