Module rustc_data_structures::sync[][src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

This mdoule 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.

LockCell is a thread safe version of Cell, with set and get operations. It can never deadlock. It uses Cell when cfg!(parallel_queries) is false, otherwise it is a Lock.

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

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

Re-exports

use std::collections::HashMap;
use std::hash::Hash;
use std::hash::BuildHasher;
use std::cmp::Ordering;
use std::marker::PhantomData;
use std::fmt::Debug;
use std::fmt::Formatter;
use std::fmt;
use std;
use std::ops::Deref;
use std::ops::DerefMut;
use owning_ref::Erased;
use owning_ref::OwningRef;
use std::cell::RefCell as InnerRwLock;
use std::cell::RefCell as InnerLock;
use std::cell::Cell;

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

ReadGuard

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

WriteGuard

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

Lock [
Experimental
]
LockCell [
Experimental
]
MTLock [
Experimental
]
Once [
Experimental
]

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

OneThread [
Experimental
]

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

RwLock [
Experimental
]

Traits

HashMapExt [
Experimental
]
Send [
Experimental
]
Sync [
Experimental
]

Functions

assert_send_sync_val [
Experimental
]
assert_send_val [
Experimental
]
assert_sync [
Experimental
]

Type Definitions

MetadataRef [
Experimental
]