Fix locks on Reader.SetReadahead

This commit is contained in:
Matt Joiner 2016-03-19 17:39:56 +11:00
parent b6cd456779
commit 4c3fffa097
1 changed files with 4 additions and 1 deletions

View File

@ -34,8 +34,11 @@ func (r *Reader) SetResponsive() {
// prioritized in preparation for further reads.
func (r *Reader) SetReadahead(readahead int64) {
r.mu.Lock()
defer r.mu.Unlock()
r.readahead = readahead
r.mu.Unlock()
r.t.cl.mu.Lock()
defer r.t.cl.mu.Unlock()
r.tickleClient()
}
func (r *Reader) readable(off int64) (ret bool) {