File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,11 @@ impl<T> Mutex<T> {
53
53
}
54
54
}
55
55
56
+ // NOTE A `Mutex` can be used as a channel so the protected data must be `Send`
57
+ // to prevent sending non-Sendable stuff (e.g. access tokens) across different
58
+ // execution contexts (e.g. interrupts)
59
+ unsafe impl < T > Sync for Mutex < T > where T : Send { }
60
+
56
61
/// ``` compile_fail
57
62
/// fn bad(cs: bare_metal::CriticalSection) -> &u32 {
58
63
/// let x = bare_metal::Mutex::new(42u32);
@@ -67,8 +72,3 @@ pub unsafe trait Nr {
67
72
/// Returns the number associated with an interrupt
68
73
fn nr ( & self ) -> u8 ;
69
74
}
70
-
71
- // NOTE A `Mutex` can be used as a channel so the protected data must be `Send`
72
- // to prevent sending non-Sendable stuff (e.g. access tokens) across different
73
- // execution contexts (e.g. interrupts)
74
- unsafe impl < T > Sync for Mutex < T > where T : Send { }
You can’t perform that action at this time.
0 commit comments