Inlineable (*reader).SetReadAhead and (*reader).Close (#594)
Small fixes that prevent inlining of public functions
This commit is contained in:
parent
a8db640c62
commit
f6b024e157
|
@ -70,10 +70,10 @@ func (r *reader) SetNonResponsive() {
|
||||||
|
|
||||||
func (r *reader) SetReadahead(readahead int64) {
|
func (r *reader) SetReadahead(readahead int64) {
|
||||||
r.mu.Lock()
|
r.mu.Lock()
|
||||||
defer r.mu.Unlock()
|
|
||||||
r.readahead = readahead
|
r.readahead = readahead
|
||||||
r.readaheadFunc = nil
|
r.readaheadFunc = nil
|
||||||
r.posChanged()
|
r.posChanged()
|
||||||
|
r.mu.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
// How many bytes are available to read. Max is the most we could require.
|
// How many bytes are available to read. Max is the most we could require.
|
||||||
|
@ -248,8 +248,8 @@ func (r *reader) readOnceAt(ctx context.Context, b []byte, pos int64) (n int, er
|
||||||
// Hodor
|
// Hodor
|
||||||
func (r *reader) Close() error {
|
func (r *reader) Close() error {
|
||||||
r.t.cl.lock()
|
r.t.cl.lock()
|
||||||
defer r.t.cl.unlock()
|
|
||||||
r.t.deleteReader(r)
|
r.t.deleteReader(r)
|
||||||
|
r.t.cl.unlock()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue