mirror of
https://github.com/bertptrs/tracing-mutex.git
synced 2025-12-27 21:40:32 +01:00
Add missing guard type aliases
This commit is contained in:
@@ -6,13 +6,19 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Added missing type aliases for the guards returned by `DebugMutex` and `DebugRwLock`. These new
|
||||||
|
type aliases function the same as the ones they belong to, resolving to either the tracing
|
||||||
|
versions when debug assertions are enabled or the standard one when they're not.
|
||||||
|
|
||||||
## [0.1.1] - 2021-05-24
|
## [0.1.1] - 2021-05-24
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- New data structure for interal dependency graph, resulting in quicker graph updates.
|
- New data structure for interal dependency graph, resulting in quicker graph updates.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Fixed an issue where internal graph ordering indices were exponential rather than sequential.
|
- Fixed an issue where internal graph ordering indices were exponential rather than sequential. This
|
||||||
|
caused the available IDs to run out way more quickly than intended.
|
||||||
|
|
||||||
## [0.1.0] - 2021-05-16 [YANKED]
|
## [0.1.0] - 2021-05-16 [YANKED]
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,12 @@ pub type DebugMutex<T> = TracingMutex<T>;
|
|||||||
#[cfg(not(debug_assertions))]
|
#[cfg(not(debug_assertions))]
|
||||||
pub type DebugMutex<T> = Mutex<T>;
|
pub type DebugMutex<T> = Mutex<T>;
|
||||||
|
|
||||||
|
/// Mutex guard for [`DebugMutex`].
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
|
pub type DebugMutexGuard<'a, T> = TracingMutexGuard<'a, T>;
|
||||||
|
#[cfg(not(debug_assertions))]
|
||||||
|
pub type DebugMutexGuard<'a, T> = MutexGuard<'a, T>;
|
||||||
|
|
||||||
/// Debug-only tracing `RwLock`.
|
/// Debug-only tracing `RwLock`.
|
||||||
///
|
///
|
||||||
/// Type alias that resolves to [`TracingRwLock`] when debug assertions are enabled and to
|
/// Type alias that resolves to [`TracingRwLock`] when debug assertions are enabled and to
|
||||||
@@ -52,6 +58,18 @@ pub type DebugRwLock<T> = TracingRwLock<T>;
|
|||||||
#[cfg(not(debug_assertions))]
|
#[cfg(not(debug_assertions))]
|
||||||
pub type DebugRwLock<T> = RwLock<T>;
|
pub type DebugRwLock<T> = RwLock<T>;
|
||||||
|
|
||||||
|
/// Read guard for [`DebugRwLock`].
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
|
pub type DebugReadGuard<'a, T> = TracingReadGuard<'a, T>;
|
||||||
|
#[cfg(not(debug_assertions))]
|
||||||
|
pub type DebugReadGuard<'a, T> = RwLockReadGuard<'a, T>;
|
||||||
|
|
||||||
|
/// Write guard for [`DebugRwLock`].
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
|
pub type DebugWriteGuard<'a, T> = TracingWriteGuard<'a, T>;
|
||||||
|
#[cfg(not(debug_assertions))]
|
||||||
|
pub type DebugWriteGuard<'a, T> = RwLockWriteGuard<'a, T>;
|
||||||
|
|
||||||
/// Debug-only tracing `Once`.
|
/// Debug-only tracing `Once`.
|
||||||
///
|
///
|
||||||
/// Type alias that resolves to [`TracingOnce`] when debug assertions are enabled and to
|
/// Type alias that resolves to [`TracingOnce`] when debug assertions are enabled and to
|
||||||
|
|||||||
Reference in New Issue
Block a user