Skip to content

Commit fbd44aa

Browse files
committed
Add parking_lot README
1 parent 978c233 commit fbd44aa

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

wrappers/parking_lot/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Shuttle support for `parking_lot`
2+
3+
This folder contains the implementation and wrapper that enables testing of [parking_lot](https://crates.io/crates/parking_lot) applications with Shuttle.
4+
5+
## How to use
6+
7+
To use it, add the following in your Cargo.toml:
8+
9+
```
10+
[features]
11+
shuttle = [
12+
"parking_lot/shuttle",
13+
]
14+
15+
[dependencies]
16+
parking_lot = { package = "shuttle-parking_lot", version = "VERSION_NUMBER" }
17+
```
18+
19+
The code will then behave as before when the `shuttle` feature flag is not provided, and will run with Shuttle-compatible primitives when the `shuttle` feature flag is provided.
20+
21+
## Limitations
22+
23+
Shuttle's parking_lot functionality is currently limited to a subset of the `Mutex` and `RwLock` primitives. If your project needs functionality which is not currently supported, please file an issue or, better yet, open a PR to contribute the functionality.

wrappers/parking_lot/parking_lot_impl/src/rwlock.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ impl<T> RwLock<T> {
3838
sem,
3939
inner: UnsafeCell::new(value),
4040
};
41+
42+
trace!("initialized parking_lot RwLock {:p}", &rwlock);
43+
4144
rwlock
4245
}
4346
}

0 commit comments

Comments
 (0)