qubit_lock/lock/mod.rs
1/*******************************************************************************
2 *
3 * Copyright (c) 2025 - 2026 Haixing Hu.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Licensed under the Apache License, Version 2.0.
8 *
9 ******************************************************************************/
10//! # Lock Module
11//!
12//! Provides synchronous and asynchronous lock abstractions along
13//! with their implementations. This module offers unified interfaces
14//! for different types of locks through traits, making it easier to
15//! write generic code that works with multiple lock types.
16//!
17
18// 子模块 `lock` 存放同步锁 trait `Lock`,与父模块同名是刻意分层;避免 clippy::module_inception 误报
19#![allow(clippy::module_inception)]
20
21// Trait definitions
22mod async_lock;
23mod lock;
24mod try_lock_error;
25
26// Implementations
27mod arc_async_mutex;
28mod arc_async_rw_lock;
29mod arc_mutex;
30mod arc_rw_lock;
31mod arc_std_mutex;
32
33// Re-export traits
34// Re-export implementations
35pub use crate::monitor::{
36 ArcMonitor,
37 Monitor,
38 MonitorGuard,
39 WaitTimeoutResult,
40 WaitTimeoutStatus,
41};
42pub use arc_async_mutex::ArcAsyncMutex;
43pub use arc_async_rw_lock::ArcAsyncRwLock;
44pub use arc_mutex::ArcMutex;
45pub use arc_rw_lock::ArcRwLock;
46pub use arc_std_mutex::ArcStdMutex;
47pub use async_lock::AsyncLock;
48pub use lock::Lock;
49pub use try_lock_error::TryLockError;