5 Commits

Author SHA1 Message Date
522ee3ffe5 Prepare release v0.3.1 2025-05-13 16:04:47 +02:00
1791ef5243 Update changelog 2025-05-13 15:57:30 +02:00
4b872c1262 Remove deprecated Cargo.toml options 2025-05-13 15:57:30 +02:00
99bca9852c Opt in to edition 2024 formatting 2025-05-13 15:57:30 +02:00
b396016224 Remove bors config 2025-05-13 15:57:30 +02:00
13 changed files with 40 additions and 32 deletions

View File

@@ -35,6 +35,8 @@ jobs:
- run: cargo build --all-features --all-targets
- run: cargo test --all-features
- run: cargo fmt --all -- --check
# Note: Rust 1.74 doesn't understand edition 2024 formatting so no point
if: "${{ matrix.rust != '1.74' }}"
- run: cargo clippy --all-features --all-targets -- -D warnings
msrv:

View File

@@ -27,6 +27,16 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Reworked CI to better test continued support for the minimum supported Rust version
### Fixed
- Support for `parking_lot` and `lock_api` can now be enabled properly with the matching feature
names.
### Deprecated
- The `parkinglot` and `lockapi` features have been deprecated. They will be removed in version 0.4.
To fix it, you can use the `parking_lot` and `lock_api` features respectively.
## [0.3.0] - 2023-09-09
### Added
@@ -114,7 +124,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
Initial release.
[Unreleased]: https://github.com/bertptrs/tracing-mutex/compare/v0.3.0...HEAD
[Unreleased]: https://github.com/bertptrs/tracing-mutex/compare/v0.3.1...HEAD
[0.3.1]: https://github.com/bertptrs/tracing-mutex/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/bertptrs/tracing-mutex/compare/v0.2.1...v0.3.0
[0.2.1]: https://github.com/bertptrs/tracing-mutex/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/bertptrs/tracing-mutex/compare/v0.1.2...v0.2.0

2
Cargo.lock generated
View File

@@ -597,7 +597,7 @@ dependencies = [
[[package]]
name = "tracing-mutex"
version = "0.3.0"
version = "0.3.1"
dependencies = [
"autocfg",
"criterion",

View File

@@ -1,10 +1,8 @@
[package]
name = "tracing-mutex"
version = "0.3.0"
authors = ["Bert Peters <bert@bertptrs.nl>"]
version = "0.3.1"
edition = "2021"
license = "MIT OR Apache-2.0"
documentation = "https://docs.rs/tracing-mutex"
categories = ["concurrency", "development-tools::debugging"]
keywords = ["mutex", "rwlock", "once", "thread"]
description = "Ensure deadlock-free mutexes by allocating in order, or else."

View File

@@ -1,11 +1,11 @@
use std::sync::Arc;
use std::sync::Mutex;
use criterion::criterion_group;
use criterion::criterion_main;
use criterion::BenchmarkId;
use criterion::Criterion;
use criterion::Throughput;
use criterion::criterion_group;
use criterion::criterion_main;
use rand::prelude::*;
use tracing_mutex::stdsync::tracing::Mutex as TracingMutex;

View File

@@ -1,6 +0,0 @@
status = [
'Rust project (1.70)',
'Rust project (stable)',
'Rust project (beta)',
'Documentation build',
]

1
rustfmt.toml Normal file
View File

@@ -0,0 +1 @@
style_edition="2024"

View File

@@ -1,7 +1,7 @@
use std::cell::Cell;
use std::collections::hash_map::Entry;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::hash_map::Entry;
use std::hash::Hash;
type Order = usize;

View File

@@ -77,12 +77,12 @@ use std::fmt;
use std::marker::PhantomData;
use std::ops::Deref;
use std::ops::DerefMut;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;
use std::sync::Mutex;
use std::sync::MutexGuard;
use std::sync::OnceLock;
use std::sync::PoisonError;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;
#[cfg(feature = "lock_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "lockapi")))]
@@ -351,9 +351,11 @@ mod tests {
drop(b);
// If b's destructor correctly ran correctly we can now add an edge from c to a.
assert!(get_dependency_graph()
.add_edge(c.value(), a.value(), Dep::capture)
.is_ok());
assert!(
get_dependency_graph()
.add_edge(c.value(), a.value(), Dep::capture)
.is_ok()
);
}
/// Test creating a cycle, then panicking.

View File

@@ -24,9 +24,9 @@ use lock_api::RawRwLockUpgradeDowngrade;
use lock_api::RawRwLockUpgradeFair;
use lock_api::RawRwLockUpgradeTimed;
use crate::util::PrivateTraced;
use crate::LazyMutexId;
use crate::MutexId;
use crate::util::PrivateTraced;
/// Tracing wrapper for all [`lock_api`] traits.
///

View File

@@ -49,18 +49,18 @@ pub mod tracing;
#[cfg(debug_assertions)]
pub use tracing::{
const_fair_mutex, const_mutex, const_reentrant_mutex, const_rwlock, FairMutex, FairMutexGuard,
MappedFairMutexGuard, MappedMutexGuard, MappedReentrantMutexGuard, MappedRwLockReadGuard,
MappedRwLockWriteGuard, Mutex, MutexGuard, Once, RawFairMutex, RawMutex, RawRwLock,
ReentrantMutex, ReentrantMutexGuard, RwLock, RwLockReadGuard, RwLockUpgradableReadGuard,
RwLockWriteGuard,
FairMutex, FairMutexGuard, MappedFairMutexGuard, MappedMutexGuard, MappedReentrantMutexGuard,
MappedRwLockReadGuard, MappedRwLockWriteGuard, Mutex, MutexGuard, Once, RawFairMutex, RawMutex,
RawRwLock, ReentrantMutex, ReentrantMutexGuard, RwLock, RwLockReadGuard,
RwLockUpgradableReadGuard, RwLockWriteGuard, const_fair_mutex, const_mutex,
const_reentrant_mutex, const_rwlock,
};
#[cfg(not(debug_assertions))]
pub use parking_lot::{
const_fair_mutex, const_mutex, const_reentrant_mutex, const_rwlock, FairMutex, FairMutexGuard,
MappedFairMutexGuard, MappedMutexGuard, MappedReentrantMutexGuard, MappedRwLockReadGuard,
MappedRwLockWriteGuard, Mutex, MutexGuard, Once, RawFairMutex, RawMutex, RawRwLock,
ReentrantMutex, ReentrantMutexGuard, RwLock, RwLockReadGuard, RwLockUpgradableReadGuard,
RwLockWriteGuard,
FairMutex, FairMutexGuard, MappedFairMutexGuard, MappedMutexGuard, MappedReentrantMutexGuard,
MappedRwLockReadGuard, MappedRwLockWriteGuard, Mutex, MutexGuard, Once, RawFairMutex, RawMutex,
RawRwLock, ReentrantMutex, ReentrantMutexGuard, RwLock, RwLockReadGuard,
RwLockUpgradableReadGuard, RwLockWriteGuard, const_fair_mutex, const_mutex,
const_reentrant_mutex, const_rwlock,
};

View File

@@ -2,8 +2,8 @@
pub use parking_lot::OnceState;
pub use parking_lot::RawThreadId;
use crate::lockapi::TracingWrapper;
use crate::LazyMutexId;
use crate::lockapi::TracingWrapper;
pub type RawFairMutex = TracingWrapper<::parking_lot::RawFairMutex>;
pub type RawMutex = TracingWrapper<::parking_lot::RawMutex>;

View File

@@ -10,9 +10,9 @@ use std::sync::TryLockResult;
use std::sync::WaitTimeoutResult;
use std::time::Duration;
use crate::util::PrivateTraced;
use crate::BorrowedMutex;
use crate::LazyMutexId;
use crate::util::PrivateTraced;
#[cfg(has_std__sync__LazyLock)]
pub use lazy_lock::LazyLock;