mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-05-19 14:06:32 +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
|
||||
subscriptions map[string]map[*loopbackNatsSubscription]bool
|
||||
|
||||
stopping bool
|
||||
wakeup sync.Cond
|
||||
incoming list.List
|
||||
}
|
||||
|
@ -53,10 +52,11 @@ func (c *LoopbackNatsClient) processMessages() {
|
|||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
for {
|
||||
for !c.stopping && c.incoming.Len() == 0 {
|
||||
for c.subscriptions != nil && c.incoming.Len() == 0 {
|
||||
c.wakeup.Wait()
|
||||
}
|
||||
if c.stopping {
|
||||
if c.subscriptions == nil {
|
||||
// Client was closed.
|
||||
break
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,6 @@ func (c *LoopbackNatsClient) Close() {
|
|||
defer c.mu.Unlock()
|
||||
|
||||
c.subscriptions = nil
|
||||
c.stopping = true
|
||||
c.incoming.Init()
|
||||
c.wakeup.Signal()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue