1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-17 02:16:54 +00:00

Change MsgChannelKeepalive to a sync.WaitGroup

This commit is contained in:
Kane York 2015-11-02 22:54:53 -08:00
parent 46887cdb5d
commit 013e49e2c5
3 changed files with 19 additions and 26 deletions

View file

@ -257,11 +257,11 @@ RunLoop:
// Stop getting messages...
UnsubscribeAll(&client)
client.MsgChannelKeepalive.Lock()
// Wait for pending jobs to finish...
client.MsgChannelKeepalive.Wait()
client.MessageChannel = nil
client.MsgChannelKeepalive.Unlock()
// And finished.
// And done.
// Close the channel so the draining goroutine can finish, too.
close(_serverMessageChan)