mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-05-04 23:03:09 +02:00
Remove unnecessary variable to flag closed loopback client.
This commit is contained in:
parent
dc55e7d5c8
commit
0b4e48af3b
|
@ -35,7 +35,6 @@ type LoopbackNatsClient struct {
|
||||||
mu sync.Mutex
|
mu sync.Mutex
|
||||||
subscriptions map[string]map[*loopbackNatsSubscription]bool
|
subscriptions map[string]map[*loopbackNatsSubscription]bool
|
||||||
|
|
||||||
stopping bool
|
|
||||||
wakeup sync.Cond
|
wakeup sync.Cond
|
||||||
incoming list.List
|
incoming list.List
|
||||||
}
|
}
|
||||||
|
@ -53,10 +52,11 @@ func (c *LoopbackNatsClient) processMessages() {
|
||||||
c.mu.Lock()
|
c.mu.Lock()
|
||||||
defer c.mu.Unlock()
|
defer c.mu.Unlock()
|
||||||
for {
|
for {
|
||||||
for !c.stopping && c.incoming.Len() == 0 {
|
for c.subscriptions != nil && c.incoming.Len() == 0 {
|
||||||
c.wakeup.Wait()
|
c.wakeup.Wait()
|
||||||
}
|
}
|
||||||
if c.stopping {
|
if c.subscriptions == nil {
|
||||||
|
// Client was closed.
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +91,6 @@ func (c *LoopbackNatsClient) Close() {
|
||||||
defer c.mu.Unlock()
|
defer c.mu.Unlock()
|
||||||
|
|
||||||
c.subscriptions = nil
|
c.subscriptions = nil
|
||||||
c.stopping = true
|
|
||||||
c.incoming.Init()
|
c.incoming.Init()
|
||||||
c.wakeup.Signal()
|
c.wakeup.Signal()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue