Struct r3::kernel::semaphore::SemaphoreDefiner
source · pub struct SemaphoreDefiner<System>where
System: KernelSemaphore,{ /* private fields */ }
Expand description
The definer (static builder) for Semaphore
.
Implementations§
source§impl<System> SemaphoreDefiner<System>where
System: KernelSemaphore,
impl<System> SemaphoreDefiner<System>where System: KernelSemaphore,
sourcepub const fn initial(self, initial: usize) -> SemaphoreDefiner<System>
pub const fn initial(self, initial: usize) -> SemaphoreDefiner<System>
[Required] Specify the initial semaphore value.
Must be less than or equal to maximum
.
sourcepub const fn maximum(self, maximum: usize) -> SemaphoreDefiner<System>
pub const fn maximum(self, maximum: usize) -> SemaphoreDefiner<System>
[Required] Specify the maximum semaphore value.
sourcepub const fn queue_order(
self,
queue_order: QueueOrder
) -> SemaphoreDefiner<System>
pub const fn queue_order( self, queue_order: QueueOrder ) -> SemaphoreDefiner<System>
Specify how tasks are sorted in the wait queue of the semaphore.
Defaults to QueueOrder::TaskPriority
when unspecified.
sourcepub const fn finish<C>(
self,
c: &mut Cfg<'_, C>
) -> SemaphoreRef<'static, System>where
C: CfgSemaphore<System = System>,
pub const fn finish<C>( self, c: &mut Cfg<'_, C> ) -> SemaphoreRef<'static, System>where C: CfgSemaphore<System = System>,
Complete the definition of a semaphore, returning a reference to the semaphore.