Crate hermit_sync

source ·
Expand description

Overview

hermit-sync provides synchronization primitives targeted at operating system kernels.

Interrupts

without_interrupts runs a closure with disabled interrupts.

Mutexes

This crate provides three kinds of mutexes based on lock_api::RawMutex:

For API documentation see lock_api::Mutex.

Initializing Static Data

There are two primitives for safely initializing static data based on generic_once_cell and RawSpinMutex:

  • OnceCell can be written to only once and can then be accessed without locking.
  • Lazy wraps a OnceCell and is initialized on the first access from a closure.

For API documentation see generic_once_cell::OnceCell and generic_once_cell::Lazy.

Type Definitions

This crate provides a lot of type definitions for ease of use:

Structs

Functions

Run a closure with disabled interrupts.

Type Definitions