Skip to main content

Module sync_primitives

Module sync_primitives 

Source
Expand description

Platform-agnostic sync primitives for FrankenSQLite.

On native targets, these re-export parking_lot types for performance. On wasm32, they provide wrappers around std::sync primitives, which work correctly in the single-threaded wasm environment without requiring unsafe Send/Sync impls.

Downstream crates should import from here instead of parking_lot directly to enable WASM compilation without #[cfg] at every call site.

Structs§

Condvar
A Condition Variable
Duration
A Duration type to represent a span of time, typically used for system timeouts.
Instant
A measurement of a monotonically nondecreasing clock. Opaque and useful only with Duration.
Once
A synchronization primitive which can be used to run a one-time initialization. Useful for one-time initialization for globals, FFI or related functionality.

Functions§

current_thread_id

Type Aliases§

Mutex
A mutual exclusion primitive useful for protecting shared data
MutexGuard
An RAII implementation of a “scoped lock” of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked.
RwLock
A reader-writer lock
RwLockReadGuard
RAII structure used to release the shared read access of a lock when dropped.
RwLockWriteGuard
RAII structure used to release the exclusive write access of a lock when dropped.