From 2e975d9b19369619efb8393bc80292ae60080f90 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Thu, 21 Nov 2024 14:23:55 +0100 Subject: [PATCH] fix(base): all `EventCacheStoreLock` must refer to the same underlying cross-process lock And not duplicate it once per `EventCacheStoreLock`. --- crates/matrix-sdk-base/src/event_cache/store/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/matrix-sdk-base/src/event_cache/store/mod.rs b/crates/matrix-sdk-base/src/event_cache/store/mod.rs index 76b7032c195..de84b89a5d8 100644 --- a/crates/matrix-sdk-base/src/event_cache/store/mod.rs +++ b/crates/matrix-sdk-base/src/event_cache/store/mod.rs @@ -43,7 +43,7 @@ pub use self::{ #[derive(Clone)] pub struct EventCacheStoreLock { /// The inner cross process lock that is used to lock the `EventCacheStore`. - cross_process_lock: CrossProcessStoreLock, + cross_process_lock: Arc>, /// The store itself. /// @@ -70,11 +70,11 @@ impl EventCacheStoreLock { let store = store.into_event_cache_store(); Self { - cross_process_lock: CrossProcessStoreLock::new( + cross_process_lock: Arc::new(CrossProcessStoreLock::new( LockableEventCacheStore(store.clone()), "default".to_owned(), holder, - ), + )), store, } }