Skip to content

Commit f65bb60

Browse files
committed
refactor(common): Rename store_locks to cross_process_lock.
1 parent 976eacb commit f65bb60

File tree

19 files changed

+33
-33
lines changed

19 files changed

+33
-33
lines changed

bindings/matrix-sdk-ffi/src/platform.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ enum LogTarget {
274274
MatrixSdkBaseResponseProcessors,
275275

276276
// SDK common modules.
277-
MatrixSdkCommonStoreLocks,
277+
MatrixSdkCommonCrossProcessLock,
278278

279279
// SDK modules.
280280
MatrixSdk,
@@ -302,7 +302,7 @@ impl LogTarget {
302302
LogTarget::MatrixSdkBaseSlidingSync => "matrix_sdk_base::sliding_sync",
303303
LogTarget::MatrixSdkBaseStoreAmbiguityMap => "matrix_sdk_base::store::ambiguity_map",
304304
LogTarget::MatrixSdkBaseResponseProcessors => "matrix_sdk_base::response_processors",
305-
LogTarget::MatrixSdkCommonStoreLocks => "matrix_sdk_common::store_locks",
305+
LogTarget::MatrixSdkCommonCrossProcessLock => "matrix_sdk_common::cross_process_lock",
306306
LogTarget::MatrixSdk => "matrix_sdk",
307307
LogTarget::MatrixSdkClient => "matrix_sdk::client",
308308
LogTarget::MatrixSdkCrypto => "matrix_sdk_crypto",
@@ -335,18 +335,18 @@ const DEFAULT_TARGET_LOG_LEVELS: &[(LogTarget, LogLevel)] = &[
335335
(LogTarget::MatrixSdkEventCache, LogLevel::Info),
336336
(LogTarget::MatrixSdkBaseEventCache, LogLevel::Info),
337337
(LogTarget::MatrixSdkEventCacheStore, LogLevel::Info),
338-
(LogTarget::MatrixSdkCommonStoreLocks, LogLevel::Warn),
338+
(LogTarget::MatrixSdkCommonCrossProcessLock, LogLevel::Warn),
339339
(LogTarget::MatrixSdkBaseStoreAmbiguityMap, LogLevel::Warn),
340340
(LogTarget::MatrixSdkUiNotificationClient, LogLevel::Info),
341341
(LogTarget::MatrixSdkBaseResponseProcessors, LogLevel::Debug),
342342
];
343343

344344
const IMMUTABLE_LOG_TARGETS: &[LogTarget] = &[
345-
LogTarget::Hyper, // Too verbose
346-
LogTarget::MatrixSdk, // Too generic
347-
LogTarget::MatrixSdkFfi, // Too verbose
348-
LogTarget::MatrixSdkCommonStoreLocks, // Too verbose
349-
LogTarget::MatrixSdkBaseStoreAmbiguityMap, // Too verbose
345+
LogTarget::Hyper, // Too verbose
346+
LogTarget::MatrixSdk, // Too generic
347+
LogTarget::MatrixSdkFfi, // Too verbose
348+
LogTarget::MatrixSdkCommonCrossProcessLock, // Too verbose
349+
LogTarget::MatrixSdkBaseStoreAmbiguityMap, // Too verbose
350350
];
351351

352352
/// A log pack can be used to set the trace log level for a group of multiple
@@ -723,7 +723,7 @@ mod tests {
723723
matrix_sdk::event_cache=info,
724724
matrix_sdk_base::event_cache=info,
725725
matrix_sdk_sqlite::event_cache_store=info,
726-
matrix_sdk_common::store_locks=warn,
726+
matrix_sdk_common::cross_process_lock=warn,
727727
matrix_sdk_base::store::ambiguity_map=warn,
728728
matrix_sdk_ui::notification_client=info,
729729
matrix_sdk_base::response_processors=debug,
@@ -767,7 +767,7 @@ mod tests {
767767
matrix_sdk::event_cache=trace,
768768
matrix_sdk_base::event_cache=trace,
769769
matrix_sdk_sqlite::event_cache_store=trace,
770-
matrix_sdk_common::store_locks=warn,
770+
matrix_sdk_common::cross_process_lock=warn,
771771
matrix_sdk_base::store::ambiguity_map=warn,
772772
matrix_sdk_ui::notification_client=trace,
773773
matrix_sdk_base::response_processors=trace,
@@ -812,7 +812,7 @@ mod tests {
812812
matrix_sdk::event_cache=trace,
813813
matrix_sdk_base::event_cache=trace,
814814
matrix_sdk_sqlite::event_cache_store=trace,
815-
matrix_sdk_common::store_locks=warn,
815+
matrix_sdk_common::cross_process_lock=warn,
816816
matrix_sdk_base::store::ambiguity_map=warn,
817817
matrix_sdk_ui::notification_client=info,
818818
matrix_sdk_base::response_processors=debug,

crates/matrix-sdk-base/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
//! Error conditions.
1717
18-
use matrix_sdk_common::store_locks::LockStoreError;
18+
use matrix_sdk_common::cross_process_lock::LockStoreError;
1919
#[cfg(feature = "e2e-encryption")]
2020
use matrix_sdk_crypto::{CryptoStoreError, MegolmError, OlmError};
2121
use thiserror::Error;

crates/matrix-sdk-base/src/event_cache/store/memory_store.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ use std::{
1919

2020
use async_trait::async_trait;
2121
use matrix_sdk_common::{
22+
cross_process_lock::memory_store_helper::try_take_leased_lock,
2223
linked_chunk::{
2324
ChunkIdentifier, ChunkIdentifierGenerator, ChunkMetadata, LinkedChunkId, Position,
2425
RawChunk, Update, relational::RelationalLinkedChunk,
2526
},
26-
store_locks::memory_store_helper::try_take_leased_lock,
2727
};
2828
use ruma::{EventId, OwnedEventId, RoomId, events::relation::RelationType, time::Instant};
2929
use tracing::error;

crates/matrix-sdk-base/src/event_cache/store/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub mod integration_tests;
2727
mod memory_store;
2828
mod traits;
2929

30-
use matrix_sdk_common::store_locks::{
30+
use matrix_sdk_common::cross_process_lock::{
3131
CrossProcessLock, CrossProcessLockGuard, LockStoreError, TryLock,
3232
};
3333
pub use matrix_sdk_store_encryption::Error as StoreEncryptionError;

crates/matrix-sdk-base/src/media/store/memory_store.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::{
2020

2121
use async_trait::async_trait;
2222
use matrix_sdk_common::{
23-
ring_buffer::RingBuffer, store_locks::memory_store_helper::try_take_leased_lock,
23+
cross_process_lock::memory_store_helper::try_take_leased_lock, ring_buffer::RingBuffer,
2424
};
2525
use ruma::{
2626
MxcUri, OwnedMxcUri,

crates/matrix-sdk-base/src/media/store/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub mod integration_tests;
3131
use std::fmt;
3232
use std::{ops::Deref, sync::Arc};
3333

34-
use matrix_sdk_common::store_locks::{
34+
use matrix_sdk_common::cross_process_lock::{
3535
CrossProcessLock, CrossProcessLockGuard, LockStoreError, TryLock,
3636
};
3737
use matrix_sdk_store_encryption::Error as StoreEncryptionError;

crates/matrix-sdk-base/src/store/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ impl StoreConfig {
791791
/// Create a new default `StoreConfig`.
792792
///
793793
/// To learn more about `cross_process_store_locks_holder_name`, please read
794-
/// [`CrossProcessLock::new`](matrix_sdk_common::store_locks::CrossProcessLock::new).
794+
/// [`CrossProcessLock::new`](matrix_sdk_common::cross_process_lock::CrossProcessLock::new).
795795
#[must_use]
796796
pub fn new(cross_process_store_locks_holder_name: String) -> Self {
797797
Self {
File renamed without changes.

crates/matrix-sdk-common/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use futures_core::Future;
2424
#[doc(no_inline)]
2525
pub use ruma;
2626

27+
pub mod cross_process_lock;
2728
pub mod debug;
2829
pub mod deserialized_responses;
2930
pub mod executor;
@@ -33,7 +34,6 @@ pub mod locks;
3334
pub mod ring_buffer;
3435
pub mod serde_helpers;
3536
pub mod sleep;
36-
pub mod store_locks;
3737
pub mod stream;
3838
pub mod timeout;
3939
pub mod tracing_timer;
@@ -45,8 +45,8 @@ pub mod ttl_cache;
4545
#[cfg(all(target_family = "wasm", not(tarpaulin_include)))]
4646
pub mod js_tracing;
4747

48+
pub use cross_process_lock::LEASE_DURATION_MS;
4849
use ruma::{RoomVersionId, room_version_rules::RoomVersionRules};
49-
pub use store_locks::LEASE_DURATION_MS;
5050

5151
/// Alias for `Send` on non-wasm, empty trait (implemented by everything) on
5252
/// wasm.

crates/matrix-sdk-crypto/src/store/crypto_store_wrapper.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::{future, ops::Deref, sync::Arc};
22

33
use futures_core::Stream;
44
use futures_util::StreamExt;
5-
use matrix_sdk_common::store_locks::CrossProcessLock;
5+
use matrix_sdk_common::cross_process_lock::CrossProcessLock;
66
use ruma::{DeviceId, OwnedDeviceId, OwnedUserId, UserId};
77
use tokio::sync::{broadcast, Mutex};
88
use tokio_stream::wrappers::{errors::BroadcastStreamRecvError, BroadcastStream};

0 commit comments

Comments
 (0)