make ReadChunk not require mutable self.

That way we can reduce lock contentions because we lock for much shorter
times.
This commit is contained in:
Dietmar Maurer
2020-07-03 07:36:23 +02:00
parent 26f499b17b
commit e9764238df
4 changed files with 23 additions and 23 deletions

View File

@ -45,7 +45,7 @@ impl<S: AsyncReadChunk, I: IndexFile> AsyncIndexReader<S, I> {
}
impl<S, I> AsyncRead for AsyncIndexReader<S, I> where
S: AsyncReadChunk + Unpin + 'static,
S: AsyncReadChunk + Unpin + Sync + 'static,
I: IndexFile + Unpin
{
fn poll_read(
@ -74,7 +74,7 @@ I: IndexFile + Unpin
this.current_chunk_digest = digest;
let mut store = match this.store.take() {
let store = match this.store.take() {
Some(store) => store,
None => {
return Poll::Ready(Err(io_format_err!("could not find store")));