forked from TrueCloudLab/frostfs-node
[#1548] morph/client: Execute close callback without switch mutex
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
7b5b735fb2
commit
b193352d1e
1 changed files with 1 additions and 2 deletions
|
@ -579,10 +579,9 @@ func (c *Client) NotificationChannel() <-chan client.Notification {
|
||||||
// - inactiveModeCb is called if not nil.
|
// - inactiveModeCb is called if not nil.
|
||||||
func (c *Client) inactiveMode() {
|
func (c *Client) inactiveMode() {
|
||||||
c.switchLock.Lock()
|
c.switchLock.Lock()
|
||||||
defer c.switchLock.Unlock()
|
|
||||||
|
|
||||||
close(c.notifications)
|
close(c.notifications)
|
||||||
c.inactive = true
|
c.inactive = true
|
||||||
|
c.switchLock.Unlock()
|
||||||
|
|
||||||
if c.cfg.inactiveModeCb != nil {
|
if c.cfg.inactiveModeCb != nil {
|
||||||
c.cfg.inactiveModeCb()
|
c.cfg.inactiveModeCb()
|
||||||
|
|
Loading…
Reference in a new issue