logos.std.sync

Module std · package logos-std

Types

structMutex

struct Mutex

A mutual-exclusion lock protecting a T, backed by a heap-allocated pthread_mutex_t.

Implements: Send Sync Drop

Fields

data: T
raw: *mut u8

structRwLock

struct RwLock

A reader-writer lock protecting a T, backed by a heap-allocated pthread_rwlock_t.

Implements: Send Sync Drop

Fields

data: T
raw: *mut u8

Functions

fnmutex_destroy

fn mutex_destroy(m: *mut Mutex<T>) -> void

Destroys the underlying pthread_mutex_t and frees the raw heap block.

fnmutex_new

fn mutex_new(data: T) -> Mutex<T>

Creates a new Mutex wrapping data, initializing the underlying pthread_mutex_t.

fnrwlock_destroy

fn rwlock_destroy(rw: *mut RwLock<T>) -> void

Destroys the underlying pthread_rwlock_t and frees the raw heap block.

fnrwlock_new

fn rwlock_new(data: T) -> RwLock<T>

Creates a new RwLock wrapping data, initializing the underlying pthread_rwlock_t.