mirror of
https://github.com/bertptrs/tracing-mutex.git
synced 2025-12-25 12:40:31 +01:00
Merge pull request #15 from bertptrs/pre-release-cleanup
This commit is contained in:
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -46,4 +46,4 @@ jobs:
|
|||||||
- uses: actions-rs/cargo@v1
|
- uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: clippy
|
command: clippy
|
||||||
args: --all-features -- -D warnings
|
args: --all-features --all-targets -- -D warnings
|
||||||
|
|||||||
17
CHANGELOG.md
17
CHANGELOG.md
@@ -6,6 +6,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.2.0]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- Generic support for wrapping mutexes that implement the traits provided by the
|
- Generic support for wrapping mutexes that implement the traits provided by the
|
||||||
[`lock_api`][lock_api] crate. This can be used for creating support for other mutex providers that
|
[`lock_api`][lock_api] crate. This can be used for creating support for other mutex providers that
|
||||||
@@ -16,6 +18,16 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|||||||
|
|
||||||
- Simple benchmark to track the rough performance penalty incurred by dependency tracking.
|
- Simple benchmark to track the rough performance penalty incurred by dependency tracking.
|
||||||
|
|
||||||
|
### Breaking
|
||||||
|
|
||||||
|
- The library now requires edition 2021.
|
||||||
|
|
||||||
|
- The `Mutex`- and `RwLockGuards` now dereference to `T` rather than the lock guard they wrap. This
|
||||||
|
is technically a bugfix but can theoretically break existing code.
|
||||||
|
|
||||||
|
- Self-cycles are no longer allowed for lock dependencies. They previously were because it usually
|
||||||
|
isn't a problem, but it can create RWR deadlocks with `RwLocks`.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- The project now targets edition 2021
|
- The project now targets edition 2021
|
||||||
@@ -43,8 +55,9 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|||||||
|
|
||||||
Initial release.
|
Initial release.
|
||||||
|
|
||||||
[Unreleased]: https://github.com/bertptrs/tracing-mutex/compare/v0.1.2...HEAD
|
[Unreleased]: https://github.com/bertptrs/tracing-mutex/compare/v0.2.0...HEAD
|
||||||
[0.1.2]: https://github.com/bertptrs/tracing-mutex/compare/v0.1.2...v0.1.2
|
[0.2.0]: https://github.com/bertptrs/tracing-mutex/compare/v0.1.2...v0.2.0
|
||||||
|
[0.1.2]: https://github.com/bertptrs/tracing-mutex/compare/v0.1.1...v0.1.2
|
||||||
[0.1.1]: https://github.com/bertptrs/tracing-mutex/compare/v0.1.0...v0.1.1
|
[0.1.1]: https://github.com/bertptrs/tracing-mutex/compare/v0.1.0...v0.1.1
|
||||||
[0.1.0]: https://github.com/bertptrs/tracing-mutex/releases/tag/v0.1.0
|
[0.1.0]: https://github.com/bertptrs/tracing-mutex/releases/tag/v0.1.0
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "tracing-mutex"
|
name = "tracing-mutex"
|
||||||
version = "0.1.2"
|
version = "0.2.0"
|
||||||
authors = ["Bert Peters <bert@bertptrs.nl>"]
|
authors = ["Bert Peters <bert@bertptrs.nl>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
|
|||||||
@@ -226,6 +226,14 @@ mod tests {
|
|||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_no_self_cycle() {
|
||||||
|
// Regression test for https://github.com/bertptrs/tracing-mutex/issues/7
|
||||||
|
let mut graph = DiGraph::default();
|
||||||
|
|
||||||
|
assert!(!graph.add_edge(1, 1));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_digraph() {
|
fn test_digraph() {
|
||||||
let mut graph = DiGraph::default();
|
let mut graph = DiGraph::default();
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_rwlock_upgradable_read_usage() {
|
fn test_rwlock_upgradable_read_usage() {
|
||||||
let lock = Arc::new(TracingRwLock::new(()));
|
let lock = TracingRwLock::new(());
|
||||||
|
|
||||||
// Should be able to acquire an upgradable read lock.
|
// Should be able to acquire an upgradable read lock.
|
||||||
let upgradable_guard: TracingRwLockUpgradableReadGuard<'_, _> = lock.upgradable_read();
|
let upgradable_guard: TracingRwLockUpgradableReadGuard<'_, _> = lock.upgradable_read();
|
||||||
|
|||||||
@@ -413,7 +413,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_mutex_usage() {
|
fn test_mutex_usage() {
|
||||||
let mutex = Arc::new(TracingMutex::new((0)));
|
let mutex = Arc::new(TracingMutex::new(0));
|
||||||
|
|
||||||
assert_eq!(*mutex.lock().unwrap(), 0);
|
assert_eq!(*mutex.lock().unwrap(), 0);
|
||||||
*mutex.lock().unwrap() = 1;
|
*mutex.lock().unwrap() = 1;
|
||||||
@@ -435,7 +435,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_rwlock_usage() {
|
fn test_rwlock_usage() {
|
||||||
let rwlock = Arc::new(TracingRwLock::new((0)));
|
let rwlock = Arc::new(TracingRwLock::new(0));
|
||||||
|
|
||||||
assert_eq!(*rwlock.read().unwrap(), 0);
|
assert_eq!(*rwlock.read().unwrap(), 0);
|
||||||
assert_eq!(*rwlock.write().unwrap(), 0);
|
assert_eq!(*rwlock.write().unwrap(), 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user