Skip to main content

Module racy

Module racy 

Source
๐Ÿ”ฌThis is a nightly-only experimental API. (thread_local_internals)
Expand description

A LazyKey implementation using racy initialization.

Unfortunately, none of the platforms currently supported by std allows creating TLS keys at compile-time. Thus we need a way to lazily create keys. Instead of blocking API like OnceLock, we use racy initialization, which should be more lightweight and avoids circular dependencies with the rest of std.

Re-exportsยง

use crate::sync::atomic::Atomic; ๐Ÿ”’ Experimental
use crate::sync::atomic::AtomicUsize; ๐Ÿ”’
use crate::sync::atomic::Ordering; ๐Ÿ”’

Structsยง

LazyKeyExperimental
A type for TLS keys that are statically allocated.

Constantsยง

KEY_SENTVAL ๐Ÿ”’ ExperimentalNeither QNX SDP 7.x nor QNX SDP 8.0+