pub trait Semaphore<T, E>where
T: ResourceMan<E>,
E: Copy + Clone,{
// Required methods
fn p(&self) -> Option<E>;
fn v(&self, e: E);
fn is_empty(&self) -> bool;
fn is_full(&self) -> bool;
// Provided methods
unsafe fn p_unguarded(&self) -> Option<E> { ... }
unsafe fn v_unguarded(&self, e: E) { ... }
}Required Methods§
Sourcefn p(&self) -> Option<E>
fn p(&self) -> Option<E>
Probeer (try): the consumer end, tries to get resource, blocks on empty
Provided Methods§
Sourceunsafe fn p_unguarded(&self) -> Option<E>
unsafe fn p_unguarded(&self) -> Option<E>
if the semaphore is also to be accessed in the epilogue level, the L2 lock is already acquired.
unsafe fn v_unguarded(&self, e: E)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".