[][src]Module rustc_data_structures::sync

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

This module defines types which are thread safe if cfg!(parallel_compiler) is true.

Lrc is an alias of Arc if cfg!(parallel_compiler) is true, Rc otherwise.

Lock is a mutex. It internally uses parking_lot::Mutex if cfg!(parallel_compiler) is true, RefCell otherwise.

RwLock is a read-write lock. It internally uses parking_lot::RwLock if cfg!(parallel_compiler) is true, RefCell otherwise.

MTLock is a mutex which disappears if cfg!(parallel_compiler) is false.

MTRef is an immutable reference if cfg!(parallel_compiler), and a mutable reference otherwise.

rustc_erase_owner! erases a OwningRef owner into Erased or Erased + Send + Sync depending on the value of cfg!(parallel_compiler).

Re-exports

pub use std::sync::atomic::Ordering::SeqCst;

Structs

LockGuard

A wrapper type for a mutably borrowed value from a RefCell<T>.

Lrc

A single-threaded reference-counting pointer. 'Rc' stands for 'Reference Counted'.

MappedLockGuard

A wrapper type for a mutably borrowed value from a RefCell<T>.

MappedReadGuard

Wraps a borrowed reference to a value in a RefCell box. A wrapper type for an immutably borrowed value from a RefCell<T>.

MappedWriteGuard

A wrapper type for a mutably borrowed value from a RefCell<T>.

ReadGuard

Wraps a borrowed reference to a value in a RefCell box. A wrapper type for an immutably borrowed value from a RefCell<T>.

Weak

Weak is a version of Rc that holds a non-owning reference to the managed allocation. The allocation is accessed by calling upgrade on the Weak pointer, which returns an Option<Rc<T>>.

WriteGuard

A wrapper type for a mutably borrowed value from a RefCell<T>.

AtomicInternal

This is a single threaded variant of AtomicU64, AtomicUsize, etc. It differs from AtomicCell in that it has explicit ordering arguments and is only intended for use with the native atomic types. You should use this type through the AtomicU64, AtomicUsize, etc, type aliases as it's not intended to be used separately.

AtomicCellInternal

This is a single threaded variant of AtomicCell provided by crossbeam. Unlike Atomic this is intended for all Copy types, but it lacks the explicit ordering arguments.

LockInternal
MTLockInternal
OnceInternal

A type whose inner value can be written once and then will stay read-only

OneThreadInternal

A type which only allows its inner value to be used in one thread. It will panic if it is used on multiple threads.

RwLockInternal
SerialScopeInternal
WorkerLocalInternal

Enums

Ordering

Atomic memory orderings

Traits

ParallelIterator

An interface for dealing with iterators.

HashMapExtInternal
SendInternal
SyncInternal

Functions

assert_sendInternal
assert_send_sync_valInternal
assert_send_valInternal
assert_syncInternal
joinInternal
par_for_each_inInternal
par_iterInternal
scopeInternal

Type Definitions

AtomicBoolInternal
AtomicU32Internal
AtomicU64Internal
AtomicUsizeInternal
MTRefInternal
MetadataRefInternal