mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-25 21:19:35 +01:00
async haxx (public Priority)
This commit is contained in:
parent
6de4f1a797
commit
41472032dc
3 changed files with 7 additions and 2 deletions
|
@ -56,7 +56,8 @@ pub fn codegen(
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
#(#cfgs)*
|
#(#cfgs)*
|
||||||
pub struct #name<'a> {
|
pub struct #name<'a> {
|
||||||
priority: &'a Priority,
|
// PER: this is unsound
|
||||||
|
pub priority: &'a Priority,
|
||||||
}
|
}
|
||||||
|
|
||||||
#(#cfgs)*
|
#(#cfgs)*
|
||||||
|
|
|
@ -165,6 +165,7 @@ pub fn codegen(
|
||||||
let constructor = quote!(
|
let constructor = quote!(
|
||||||
impl<#lt> #ident<#lt> {
|
impl<#lt> #ident<#lt> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
|
// pub const unsafe fn new(#arg) -> Self {
|
||||||
pub unsafe fn new(#arg) -> Self {
|
pub unsafe fn new(#arg) -> Self {
|
||||||
#ident {
|
#ident {
|
||||||
#(#values,)*
|
#(#values,)*
|
||||||
|
|
|
@ -78,7 +78,7 @@ impl Priority {
|
||||||
///
|
///
|
||||||
/// Will overwrite the current Priority
|
/// Will overwrite the current Priority
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub unsafe fn new(value: u8) -> Self {
|
pub const unsafe fn new(value: u8) -> Self {
|
||||||
Priority {
|
Priority {
|
||||||
inner: Cell::new(value),
|
inner: Cell::new(value),
|
||||||
}
|
}
|
||||||
|
@ -98,6 +98,9 @@ impl Priority {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PER: not sure if this is a problem
|
||||||
|
unsafe impl Sync for Priority {}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn assert_send<T>()
|
pub fn assert_send<T>()
|
||||||
where
|
where
|
||||||
|
|
Loading…
Reference in a new issue