From b54d503d40a28909a8e410fbf6806b6b2f77505b Mon Sep 17 00:00:00 2001 From: Tomer Filiba Date: Sat, 17 Aug 2024 16:54:42 +0300 Subject: [PATCH] List iterators: hold lock when calling find_true_head/tail --- src/lists.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lists.rs b/src/lists.rs index 87c4e09..8152fb1 100644 --- a/src/lists.rs +++ b/src/lists.rs @@ -138,6 +138,7 @@ impl<'a> Iterator for LinkedListIterator<'a> { type Item = Result>; fn next(&mut self) -> Option { if self.fph.is_none() { + let _guard = self.store._list_lock(self.list_ph); let buf = match self.store.get_raw(&self.list_key) { Ok(buf) => buf, Err(e) => return Some(Err(e)), @@ -193,6 +194,7 @@ impl<'a> Iterator for RevLinkedListIterator<'a> { type Item = Result>; fn next(&mut self) -> Option { if self.fph.is_none() { + let _guard = self.store._list_lock(self.list_ph); let buf = match self.store.get_raw(&self.list_key) { Ok(buf) => buf, Err(e) => return Some(Err(e)),