Commit f543e81a authored by Steven Allen's avatar Steven Allen

remove useless double lock (and fix possible race?)

parent 3d219ca0
......@@ -87,13 +87,13 @@ func (re *responseEmitter) isClosed() bool {
}
func (re *responseEmitter) Close() error {
if re.isClosed() {
return errors.New("closing closed responseemitter")
}
re.wLock.Lock()
defer re.wLock.Unlock()
if re.closed {
return errors.New("closing closed responseemitter")
}
re.ch <- re.exit
close(re.ch)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment