Struct cortex_m_rtfm::Resource
[−]
[src]
pub struct Resource<T, C> { /* fields omitted */ }
A resource with ceiling C
A resource is used to share memory between two or more tasks
Methods
impl<T, RC> Resource<T, RC> where
RC: GreaterThanOrEqual<U0>,
RC: LessThanOrEqual<UMax>,
[src]
RC: GreaterThanOrEqual<U0>,
RC: LessThanOrEqual<UMax>,
const fn new(data: T) -> Self
Creates a new resource
impl<T, RC> Resource<T, RC>
[src]
fn access<'cs, TP, PT>(
&'static self,
_task_priority: &Priority<TP>,
_preemption_threshold: &'cs Threshold<PT>
) -> Ref<'cs, T> where
RC: GreaterThanOrEqual<TP>,
PT: GreaterThanOrEqual<RC>,
&'static self,
_task_priority: &Priority<TP>,
_preemption_threshold: &'cs Threshold<PT>
) -> Ref<'cs, T> where
RC: GreaterThanOrEqual<TP>,
PT: GreaterThanOrEqual<RC>,
Grants data race free and deadlock free access to the resource data
This operation is zero cost and doesn't impose any additional blocking.
Requirements
To access the resource data these conditions must be met:
- The resource ceiling must be greater than or equal to the task priority
- The preemption threshold must be greater than or equal to the resource ceiling
Trait Implementations
impl<T, C> Sync for Resource<T, C> where
T: Send,
[src]
T: Send,
impl<T, RC> ResourceLike for Resource<T, RC>
[src]
type Ceiling = RC
The ceiling of the resource