Added missing lock when reading field (was already used when writing field)

This avoids a data race found in tests involving disconnecting the client with the `-race` flag.
This commit is contained in:
Daniel Cormier 2017-03-17 16:09:22 -04:00
parent fe537904e1
commit 1c770bb431
1 changed files with 3 additions and 0 deletions

View File

@ -74,6 +74,9 @@ func (c *Channel) Id() string {
Checks that Channel is still alive
*/
func (c *Channel) IsAlive() bool {
c.aliveLock.Lock()
defer c.aliveLock.Unlock()
return c.alive
}