1
0
Fork 0
forked from External/ergo

add Semaphore and ServerSemaphores

This commit is contained in:
Shivaram Lingamneni 2018-04-24 20:34:28 -04:00
parent 6533893863
commit ebfef1e848
4 changed files with 98 additions and 16 deletions

View file

@ -675,6 +675,11 @@ func (client *Client) destroy(beingResumed bool) {
return
}
// see #235: deduplicating the list of PART recipients uses (comparatively speaking)
// a lot of RAM, so limit concurrency to avoid thrashing
client.server.semaphores.ClientDestroy.Acquire()
defer client.server.semaphores.ClientDestroy.Release()
if beingResumed {
client.server.logger.Debug("quit", fmt.Sprintf("%s is being resumed", client.nick))
} else {