Lexical changes

This commit is contained in:
Qian Wang 2018-12-30 00:28:38 +00:00
parent deb5271cef
commit 1cb7bff8b3
2 changed files with 5 additions and 3 deletions

View File

@ -38,8 +38,8 @@ type Session struct {
// For accepting new streams
acceptCh chan *Stream
die chan struct{}
overdose sync.Once // fentanyl? beware of respiratory depression
die chan struct{}
suicide sync.Once
}
// 1 conn is needed to make a session
@ -146,7 +146,7 @@ func (sesh *Session) addStream(id uint32) *Stream {
func (sesh *Session) Close() error {
// Because closing a closed channel causes panic
sesh.overdose.Do(func() { close(sesh.die) })
sesh.suicide.Do(func() { close(sesh.die) })
sesh.streamsM.Lock()
for id, stream := range sesh.streams {
// If we call stream.Close() here, streamsM will result in a deadlock

View File

@ -13,6 +13,8 @@ import (
// FIXME: sanity checks. The server may panic due to user input
// TODO: manual backup
/*
0 reserved
1 listActiveUsers none []uids