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