ARMv7-R: implement Sync for Pool

This commit is contained in:
Jorge Aparicio 2019-05-03 18:43:46 +02:00
parent 91dfd3ccb8
commit 110239f0c1
4 changed files with 8 additions and 2 deletions

View File

@ -10,6 +10,10 @@ matrix:
- env: TARGET=x86_64-unknown-linux-gnu
rust: nightly
- env: TARGET=armv7r-none-eabi
rust: nightly
if: branch != master
- env: TARGET=thumbv6m-none-eabi
rust: nightly
if: branch != master

View File

@ -11,6 +11,8 @@ fn main() -> Result<(), Box<Error>> {
println!("cargo:rustc-cfg=armv7m");
} else if target.starts_with("thumbv7em-") {
println!("cargo:rustc-cfg=armv7m");
} else if target.starts_with("armv7r-") {
println!("cargo:rustc-cfg=armv7r");
}
Ok(())

View File

@ -178,7 +178,7 @@ pub struct Pool<T> {
// NOTE: Here we lie about `Pool` implementing `Sync` on x86_64. This is not true but it lets us
// test the `pool!` and `singleton::Pool` abstractions. We just have to be careful not to use the
// pool in a multi-threaded context
#[cfg(any(armv7m, test))]
#[cfg(any(armv7m, armv7r, test))]
unsafe impl<T> Sync for Pool<T> {}
unsafe impl<T> Send for Pool<T> {}

View File

@ -15,7 +15,7 @@ use as_slice::{AsMutSlice, AsSlice};
use super::{Init, Uninit};
/// Instantiates a pool as a global singleton
#[cfg(any(armv7m, test))]
#[cfg(any(armv7m, armv7r, test))]
#[macro_export]
macro_rules! pool {
($ident:ident: $ty:ty) => {