channel: Kill a race condition that locked up the server.

Specifically, if you joined a channel while someone else was trying to part. the Join method would grab the lock, the Quit method would queue to grab the lock, the Join method would unlock and then try to regrab the lock, and it would get into a situation where nobody would have the lock and everyone would be waiting for it.

This caused weird oddities with clients.
This commit is contained in:
Daniel Oaks 2017-03-26 22:11:09 +10:00
parent cec3416eae
commit 300d02bd9c
2 changed files with 12 additions and 13 deletions

View file

@ -482,7 +482,7 @@ func (client *Client) destroy() {
// clean up channels
for channel := range client.channels {
channel.Quit(client)
channel.Quit(client, &friends)
}
// clean up server