From 78757599fe37fe21ab7a6d092baa11a363f4119d Mon Sep 17 00:00:00 2001 From: rmeng Date: Thu, 3 Aug 2023 11:15:07 -0400 Subject: [PATCH] take an arc runtime --- src/lib.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 530f050..a3a4a56 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -449,7 +449,7 @@ pub fn new_object_store_directory( read_version: Option, write_version: u64, cache_loc: Option<&str>, - rt: Option, + rt: Option>, ) -> Result, std::io::Error> { if let Some(read_version) = read_version { if read_version > write_version { @@ -471,13 +471,12 @@ pub fn new_object_store_directory( write_version, local_fs: Arc::new(LocalFileSystem::new()), cache_loc, - rt: Arc::new( - rt.unwrap_or( - tokio::runtime::Builder::new_multi_thread() - .enable_all() - .build()?, - ), - ), + rt: rt.unwrap_or(Arc::new( + tokio::runtime::Builder::new_multi_thread() + .enable_all() + .build()?, + )), + atomic_rw_lock: Arc::new(Mutex::new(())), })) }