From fa2a816e66d659bb26c35d42c746fa034ab0946a Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 13 Oct 2020 22:19:27 +0000 Subject: [PATCH] . --- src/db_3.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/db_3.rs b/src/db_3.rs index 2c2188d..3aa35a5 100644 --- a/src/db_3.rs +++ b/src/db_3.rs @@ -24,8 +24,7 @@ pub struct Db { config: DbConfig, stores: BTreeMap, fs_thread: Arc, - next_batch: AtomicU64, - next_view: AtomicU64, + next_batch_view: AtomicU64, } struct Store { @@ -71,8 +70,7 @@ impl Db { config, stores, fs_thread, - next_batch: AtomicU64::new(0), - next_view: AtomicU64::new(0), + next_batch_view: AtomicU64::new(0), }); fn tree_path(dir: &Path, tree: &str) -> Result { @@ -83,7 +81,7 @@ impl Db { impl Db { pub fn new_batch(&self) -> u64 { - let next = self.next_batch.fetch_add(1, Ordering::Relaxed); + let next = self.next_batch_view.fetch_add(1, Ordering::Relaxed); assert_ne!(next, u64::max_value()); next } @@ -120,7 +118,7 @@ impl Db { impl Db { pub fn new_view(&self) -> u64 { - let next = self.next_view.fetch_add(1, Ordering::Relaxed); + let next = self.next_batch_view.fetch_add(1, Ordering::Relaxed); assert_ne!(next, u64::max_value()); next }