Skip to content

Commit

Permalink
Merge pull request #15 from bertptrs/pre-release-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bertptrs authored May 7, 2022
2 parents 46c92cf + 3ec7e83 commit 2f6e214
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features -- -D warnings
args: --all-features --all-targets -- -D warnings
17 changes: 15 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.2.0]

### Added
- 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
Expand All @@ -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.

### 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

- The project now targets edition 2021
Expand Down Expand Up @@ -43,8 +55,9 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Initial release.

[Unreleased]: https://github.com/bertptrs/tracing-mutex/compare/v0.1.2...HEAD
[0.1.2]: https://github.com/bertptrs/tracing-mutex/compare/v0.1.2...v0.1.2
[Unreleased]: https://github.com/bertptrs/tracing-mutex/compare/v0.2.0...HEAD
[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.0]: https://github.com/bertptrs/tracing-mutex/releases/tag/v0.1.0

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tracing-mutex"
version = "0.1.2"
version = "0.2.0"
authors = ["Bert Peters <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down
8 changes: 8 additions & 0 deletions src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,14 @@ mod tests {

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]
fn test_digraph() {
let mut graph = DiGraph::default();
Expand Down
2 changes: 1 addition & 1 deletion src/parkinglot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ mod tests {

#[test]
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.
let upgradable_guard: TracingRwLockUpgradableReadGuard<'_, _> = lock.upgradable_read();
Expand Down
4 changes: 2 additions & 2 deletions src/stdsync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ mod tests {

#[test]
fn test_mutex_usage() {
let mutex = Arc::new(TracingMutex::new((0)));
let mutex = Arc::new(TracingMutex::new(0));

assert_eq!(*mutex.lock().unwrap(), 0);
*mutex.lock().unwrap() = 1;
Expand All @@ -435,7 +435,7 @@ mod tests {

#[test]
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.write().unwrap(), 0);
Expand Down

0 comments on commit 2f6e214

Please sign in to comment.