Skip to content

Commit

Permalink
Docs: a LocalKey might start in the Valid state
Browse files Browse the repository at this point in the history
  • Loading branch information
Stjepan Glavina committed Oct 17, 2017
1 parent 2d75213 commit a50fe31
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libstd/thread/local.rs
Expand Up @@ -325,7 +325,10 @@ impl<T: 'static> LocalKey<T> {
///
/// Once the initialization expression succeeds, the key transitions to the
/// `Valid` state which will guarantee that future calls to [`with`] will
/// succeed within the thread.
/// succeed within the thread. Some keys might skip the `Uninitialized`
/// state altogether and start in the `Valid` state as an optimization
/// (e.g. keys initialized with a constant expression), but no guarantees
/// are made.
///
/// When a thread exits, each key will be destroyed in turn, and as keys are
/// destroyed they will enter the `Destroyed` state just before the
Expand Down

0 comments on commit a50fe31

Please sign in to comment.