Skip to content

Commit 0c8f10e

Browse files
bors[bot]adamgreig
andcommitted
Merge #13
13: Add note about mutex unsafety on multi-core systems r=japaric a=adamgreig See #12. Co-authored-by: Adam Greig <[email protected]>
2 parents b13a53a + c222b50 commit 0c8f10e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ impl CriticalSection {
6969
}
7070

7171
/// A "mutex" based on critical sections
72+
///
73+
/// # Safety
74+
///
75+
/// **This Mutex is only safe on single-core systems.**
76+
///
77+
/// On multi-core systems, a `CriticalSection` **is not sufficient** to ensure exclusive access.
7278
pub struct Mutex<T> {
7379
inner: UnsafeCell<T>,
7480
}

0 commit comments

Comments
 (0)