func (r *reader) SetReadahead(readahead int64) {
r.mu.Lock()
- defer r.mu.Unlock()
r.readahead = readahead
r.readaheadFunc = nil
r.posChanged()
+ r.mu.Unlock()
}
// How many bytes are available to read. Max is the most we could require.
// Hodor
func (r *reader) Close() error {
r.t.cl.lock()
- defer r.t.cl.unlock()
r.t.deleteReader(r)
+ r.t.cl.unlock()
return nil
}