Skip to content

Commit 43df59a

Browse files
bors[bot]bertptrs
andauthored
Merge #33
33: Prepare for release 0.3.0 r=bertptrs a=bertptrs Double check - [x] documentation - [x] changelog - [x] tests Co-authored-by: Bert Peters <[email protected]>
2 parents d8c559f + 1fe44d0 commit 43df59a

File tree

3 files changed

+37
-6
lines changed

3 files changed

+37
-6
lines changed

CHANGELOG.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,26 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
88

9+
## [0.3.0] - 2023-09-09
10+
911
### Added
1012

1113
- The minimum supported Rust version is now defined as 1.70. Previously it was undefined.
1214
- Wrappers for `std::sync` primitives can now be `const` constructed.
1315
- Add support for `std::sync::OnceLock`
14-
- Added backtraces of mutex allocations to the cycle report.
16+
- Added backtraces of mutex allocations to the cycle report. Capturing backtraces does incur some
17+
overhead, this can be mitigated by disabling the `backtraces` feature which is enabled by default.
1518

1619
### Breaking
1720

1821
- Update [`parking_lot`][parking_lot] dependency to `0.12`.
19-
- Restructured the crate to reduce typename verbosity. For details, see: #25.
22+
- Restructured the crate to reduce typename verbosity. Wrapper names now match the name of the
23+
primitive they wrap. Specific always/debug tracing versions have now moved to separate modules.
24+
For example, `tracing_mutex::stdsync::TracingMutex` is now
25+
`tracing_mutex::stdsync::tracing::Mutex`, and `tracing_mutex::stdsync::DebugMutex` is now called
26+
`tracing_mutex::stdsync::Mutex`. This hopefully reduces the visual noise while reading code that
27+
uses this in practice. Unwrapped primitives are reexported under `tracing_mutex::stdsync::raw` for
28+
convenience.
2029

2130
### Fixed
2231

@@ -84,7 +93,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8493

8594
Initial release.
8695

87-
[Unreleased]: https://github.com/bertptrs/tracing-mutex/compare/v0.2.1...HEAD
96+
[Unreleased]: https://github.com/bertptrs/tracing-mutex/compare/v0.3.0...HEAD
97+
[0.3.0]: https://github.com/bertptrs/tracing-mutex/compare/v0.2.1...v0.3.0
8898
[0.2.1]: https://github.com/bertptrs/tracing-mutex/compare/v0.2.0...v0.2.1
8999
[0.2.0]: https://github.com/bertptrs/tracing-mutex/compare/v0.1.2...v0.2.0
90100
[0.1.2]: https://github.com/bertptrs/tracing-mutex/compare/v0.1.1...v0.1.2

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tracing-mutex"
3-
version = "0.2.1"
3+
version = "0.3.0"
44
authors = ["Bert Peters <[email protected]>"]
55
edition = "2021"
66
license = "MIT OR Apache-2.0"

src/lib.rs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,23 @@
1818
//! # Structure
1919
//!
2020
//! Each module in this crate exposes wrappers for a specific base-mutex with dependency trakcing
21-
//! added. For now, that is limited to [`stdsync`] which provides wrappers for the base locks in the
22-
//! standard library. More back-ends may be added as features in the future.
21+
//! added. This includes [`stdsync`] which provides wrappers for the base locks in the standard
22+
//! library, and more depending on enabled compile-time features. More back-ends may be added as
23+
//! features in the future.
24+
//!
25+
//! # Feature flags
26+
//!
27+
//! `tracing-mutex` uses feature flags to reduce the impact of this crate on both your compile time
28+
//! and runtime overhead. Below are the available flags. Modules are annotated with the features
29+
//! they require.
30+
//!
31+
//! - `backtraces`: Enables capturing backtraces of mutex dependencies, to make it easier to
32+
//! determine what sequence of events would trigger a deadlock. This is enabled by default, but if
33+
//! the performance overhead is unaccceptable, it can be disabled by disabling default features.
34+
//!
35+
//! - `lockapi`: Enables the wrapper lock for [`lock_api`][lock_api] locks
36+
//!
37+
//! - `parkinglot`: Enables wrapper types for [`parking_lot`][parking_lot] mutexes
2338
//!
2439
//! # Performance considerations
2540
//!
@@ -44,7 +59,13 @@
4459
//! (such as [`stdsync::Mutex`]) which evaluate to a tracing mutex when debug assertions are
4560
//! enabled, and to the underlying mutex when they're not.
4661
//!
62+
//! For ease of debugging, this crate will, by default, capture a backtrace when establishing a new
63+
//! dependency between two mutexes. This has an additional overhead of over 60%. If this additional
64+
//! debugging aid is not required, it can be disabled by disabling default features.
65+
//!
4766
//! [paper]: https://whileydave.com/publications/pk07_jea/
67+
//! [lock_api]: https://docs.rs/lock_api/0.4/lock_api/index.html
68+
//! [parking_lot]: https://docs.rs/parking_lot/0.12.1/parking_lot/
4869
#![cfg_attr(docsrs, feature(doc_cfg))]
4970
use std::cell::RefCell;
5071
use std::fmt;

0 commit comments

Comments
 (0)