diff options
author | 2017-05-08 13:25:20 -0500 | |
---|---|---|
committer | 2017-05-08 13:25:20 -0500 | |
commit | c1a0f8173af87c55aa75f1c8a7a3a9b46a624b48 (patch) | |
tree | eb3828c5f5424eb1100d0e6d54eb2fd4d7c898a5 /src | |
parent | fc4cb7d472dad1ea0fa137bb116bd907efc19601 (diff) | |
download | rtic-c1a0f8173af87c55aa75f1c8a7a3a9b46a624b48.tar.gz rtic-c1a0f8173af87c55aa75f1c8a7a3a9b46a624b48.tar.zst rtic-c1a0f8173af87c55aa75f1c8a7a3a9b46a624b48.zip |
require Resource protected data to be Send, make tokens !Send
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -419,6 +419,7 @@ #![deny(warnings)] #![feature(asm)] #![feature(const_fn)] +#![feature(optin_builtin_traits)] #![no_std] extern crate cortex_m; @@ -533,7 +534,11 @@ impl<T, RC> Resource<T, Ceiling<RC>> { } } -unsafe impl<T, C> Sync for Resource<T, C> {} +unsafe impl<T, C> Sync for Resource<T, C> +where + T: Send, +{ +} /// A hardware peripheral as a resource /// @@ -684,6 +689,8 @@ pub struct Ceiling<N> { _marker: PhantomData<N>, } +impl<N> !Send for Ceiling<N> {} + /// Preemption threshold pub struct Threshold<T> { _marker: PhantomData<T>, @@ -710,6 +717,8 @@ impl<PT> Threshold<PT> { } } +impl<N> !Send for Threshold<N> {} + /// Priority pub struct Priority<N> { _marker: PhantomData<N>, @@ -725,6 +734,8 @@ where } } +impl<N> !Send for Priority<N> {} + /// Maps a `Resource` / `Peripheral` to its ceiling /// /// Do not implement this trait yourself. This is an implementation detail. |