Module gix_features::threading
source · Expand description
Type definitions for putting shared ownership and synchronized mutation behind the threading feature toggle.
That way, single-threaded applications will not have to use thread-safe primitives, and simply do not specify the ‘threading’ feature.
Functions
- downgrade_mut_to_ref
parallelDowngrade a handle previously obtained withget_mut()to drop mutation support. - get_mut
parallelGet a mutable reference through aMutableOnDemandfor read-write access. - get_ref
parallelGet a shared reference through aMutableOnDemandfor read-only access. - lock
parallelGet a mutable reference through aMutablefor read-write access. - make_mut
parallelGet a mutable reference to the underlying data, with semantics similar to Arc::make_mut(). - map_ref
parallelMap a read guard into a sub-type it contains.
Type Aliases
- MappedRefGuard
parallelA mapped reference created from aRefGuard - Mutable
parallelA synchronization primitive which provides read-write access right away. - MutableOnDemand
parallelA synchronization primitive which can start read-only and transition to support mutation. - OnceCell
parallelA thread-safe cell which can be written to only once. - OwnShared
parallelA reference counted pointer type for shared ownership. - RefGuard
parallelA guarded reference suitable for safekeeping in a struct.