pub unsafe trait KernelSemaphore: KernelBase {
    type RawSemaphoreId: Id;

    // Required methods
    unsafe fn raw_semaphore_drain(
        this: Self::RawSemaphoreId
    ) -> Result<(), DrainSemaphoreError>;
    unsafe fn raw_semaphore_get(
        this: Self::RawSemaphoreId
    ) -> Result<usize, GetSemaphoreError>;
    unsafe fn raw_semaphore_signal(
        this: Self::RawSemaphoreId,
        count: usize
    ) -> Result<(), SignalSemaphoreError>;
    unsafe fn raw_semaphore_signal_one(
        this: Self::RawSemaphoreId
    ) -> Result<(), SignalSemaphoreError>;
    unsafe fn raw_semaphore_wait_one(
        this: Self::RawSemaphoreId
    ) -> Result<(), WaitSemaphoreError>;
    unsafe fn raw_semaphore_wait_one_timeout(
        this: Self::RawSemaphoreId,
        timeout: Duration
    ) -> Result<(), WaitSemaphoreTimeoutError>;
    unsafe fn raw_semaphore_poll_one(
        this: Self::RawSemaphoreId
    ) -> Result<(), PollSemaphoreError>;
}
Expand description

Provides access to the semaphore API exposed by a kernel.

Safety

See the Safety section of the module documentation.

Required Associated Types§

source

type RawSemaphoreId: Id

The type to identify semaphores.

Required Methods§

source

unsafe fn raw_semaphore_drain( this: Self::RawSemaphoreId ) -> Result<(), DrainSemaphoreError>

Implements Semaphore::drain.

Safety

See the Safety section of the module documentation.

source

unsafe fn raw_semaphore_get( this: Self::RawSemaphoreId ) -> Result<usize, GetSemaphoreError>

Implements Semaphore::get.

Safety

See the Safety section of the module documentation.

source

unsafe fn raw_semaphore_signal( this: Self::RawSemaphoreId, count: usize ) -> Result<(), SignalSemaphoreError>

Implements Semaphore::signal.

Safety

See the Safety section of the module documentation.

source

unsafe fn raw_semaphore_signal_one( this: Self::RawSemaphoreId ) -> Result<(), SignalSemaphoreError>

Implements Semaphore::signal_one.

Safety

See the Safety section of the module documentation.

source

unsafe fn raw_semaphore_wait_one( this: Self::RawSemaphoreId ) -> Result<(), WaitSemaphoreError>

Implements Semaphore::wait_one.

Safety

See the Safety section of the module documentation.

source

unsafe fn raw_semaphore_wait_one_timeout( this: Self::RawSemaphoreId, timeout: Duration ) -> Result<(), WaitSemaphoreTimeoutError>

Implements Semaphore::wait_one_timeout.

Safety

See the Safety section of the module documentation.

source

unsafe fn raw_semaphore_poll_one( this: Self::RawSemaphoreId ) -> Result<(), PollSemaphoreError>

Implements Semaphore::poll_one.

Safety

See the Safety section of the module documentation.

Implementors§