[][src]Module rustc_data_structures::sync

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

Lrc is an alias of either Rc or Arc.

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

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

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

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

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

Re-exports

pub use std::sync::atomic::Ordering::SeqCst;
pub use self::serial_join as join;
pub use self::serial_scope as scope;

Structs

Atomic
Lock
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'.

MTLock
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>.

Once

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

OneThread

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

ReadGuard

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

RwLock
SerialScope
Weak

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

WorkerLocal
WriteGuard

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

Enums

Ordering

Atomic memory orderings

Traits

HashMapExt
ParallelIterator

An interface for dealing with iterators.

Send
Sync

Functions

assert_send
assert_send_sync_val
assert_send_val
assert_sync
par_iter
serial_join
serial_scope

Type Definitions

AtomicBool
AtomicU32
AtomicU64
AtomicUsize
MTRef
MetadataRef