You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,6 +99,25 @@ provide an implementation based on `std::sync::Mutex`, so you don't have to add
99
99
critical-section = { version = "1.1", features = ["std"]}
100
100
```
101
101
102
+
## Usage in [`loom`] tests
103
+
104
+
`critical-section` supports [`loom`] by enabling the `std` feature and passing `--cfg loom` as `RUSTFLAGS` (either through `.cargo/config.toml`, or through the environment variable).
105
+
This implementation is identical to the normal `std` implementation, but uses `loom` synchronization primitives instead.
106
+
107
+
`Cargo.toml`:
108
+
```toml
109
+
[dependencies]
110
+
critical-section = { version = "1.1", features = ["std"] }
0 commit comments