Trait r3::kernel::traits::KernelMutex

source ·
pub unsafe trait KernelMutex: KernelBase {
    type RawMutexId: Id;

    const RAW_SUPPORTED_MUTEX_PROTOCOLS: &'static [Option<MutexProtocolKind>] = &[];

    // Required methods
    unsafe fn raw_mutex_is_locked(
        this: Self::RawMutexId
    ) -> Result<bool, QueryMutexError>;
    unsafe fn raw_mutex_unlock(
        this: Self::RawMutexId
    ) -> Result<(), UnlockMutexError>;
    unsafe fn raw_mutex_lock(
        this: Self::RawMutexId
    ) -> Result<(), LockMutexError>;
    unsafe fn raw_mutex_lock_timeout(
        this: Self::RawMutexId,
        timeout: Duration
    ) -> Result<(), LockMutexTimeoutError>;
    unsafe fn raw_mutex_try_lock(
        this: Self::RawMutexId
    ) -> Result<(), TryLockMutexError>;
    unsafe fn raw_mutex_mark_consistent(
        this: Self::RawMutexId
    ) -> Result<(), MarkConsistentMutexError>;
}
Expand description

Provides access to the mutex API exposed by a kernel.

Safety

See the Safety section of the module documentation.

Required Associated Types§

source

type RawMutexId: Id

The type to identify mutexes.

Provided Associated Constants§

source

const RAW_SUPPORTED_MUTEX_PROTOCOLS: &'static [Option<MutexProtocolKind>] = &[]

Used by MutexProtocol::is_supported.

None elements don’t match any values of MutexProtocol. This might be useful for conditionally enabling some of them.

The default value is an empty slice.

Required Methods§

source

unsafe fn raw_mutex_is_locked( this: Self::RawMutexId ) -> Result<bool, QueryMutexError>

Implements Mutex::is_locked.

Safety

See the Safety section of the module documentation.

source

unsafe fn raw_mutex_unlock( this: Self::RawMutexId ) -> Result<(), UnlockMutexError>

Implements Mutex::unlock.

Safety

See the Safety section of the module documentation.

source

unsafe fn raw_mutex_lock(this: Self::RawMutexId) -> Result<(), LockMutexError>

Implements Mutex::lock.

Safety

See the Safety section of the module documentation.

source

unsafe fn raw_mutex_lock_timeout( this: Self::RawMutexId, timeout: Duration ) -> Result<(), LockMutexTimeoutError>

Implements Mutex::lock_timeout.

Safety

See the Safety section of the module documentation.

source

unsafe fn raw_mutex_try_lock( this: Self::RawMutexId ) -> Result<(), TryLockMutexError>

Implements Mutex::try_lock.

Safety

See the Safety section of the module documentation.

source

unsafe fn raw_mutex_mark_consistent( this: Self::RawMutexId ) -> Result<(), MarkConsistentMutexError>

Implements Mutex::mark_consistent.

Safety

See the Safety section of the module documentation.

Implementors§