about summary refs log tree commit diff
path: root/src/libstd/thread
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2020-07-14 13:19:28 -0700
committerGitHub <noreply@github.com>2020-07-14 13:19:28 -0700
commitfadd91c630bb4cf606f7ef3ec68d7b6cbcb363b5 (patch)
tree8301e8592fa8efd518869065e902c007750ce455 /src/libstd/thread
parent1e74f285998daf6809d2d418d2bbe1ab094e694e (diff)
parent7dc388654d6ef038065db23340e8eff7a567e5b4 (diff)
downloadrust-fadd91c630bb4cf606f7ef3ec68d7b6cbcb363b5.tar.gz
rust-fadd91c630bb4cf606f7ef3ec68d7b6cbcb363b5.zip
Rollup merge of #74263 - RalfJung:thread-local, r=Mark-Simulacrum
Slight reorganization of sys/(fast_)thread_local

I was long confused by the `thread_local` and `fast_thread_local` modules in the `sys(_common)` part of libstd. The names make it *sound* like `fast_thread_local` is just a faster version of `thread_local`, but really these are totally different APIs: one provides thread-local "keys", which are non-addressable pointer-sized pieces of local storage with an associated destructor; the other (the "fast" one) provides just a destructor.

So I propose we rename `fast_thread_local` to `thread_local_dtor`, and `thread_local` to `thread_local_key`. That's what this PR does.
Diffstat (limited to 'src/libstd/thread')
-rw-r--r--src/libstd/thread/local.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index 094c468a677..ecd6fbc6b93 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -363,7 +363,7 @@ pub mod fast {
     use crate::cell::Cell;
     use crate::fmt;
     use crate::mem;
-    use crate::sys::fast_thread_local::register_dtor;
+    use crate::sys::thread_local_dtor::register_dtor;
 
     #[derive(Copy, Clone)]
     enum DtorState {
@@ -468,7 +468,7 @@ pub mod os {
     use crate::fmt;
     use crate::marker;
     use crate::ptr;
-    use crate::sys_common::thread_local::StaticKey as OsStaticKey;
+    use crate::sys_common::thread_local_key::StaticKey as OsStaticKey;
 
     pub struct Key<T> {
         // OS-TLS key that we'll use to key off.