diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2016-02-16 23:07:09 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2017-06-23 16:11:39 -0700 |
| commit | 06540cb205545e5e7e509933af27142ca35eae17 (patch) | |
| tree | 61ae222629f05fdd91587e2b58e4dda3b95c1bea /src/libstd/sys/windows/mod.rs | |
| parent | 622e7e6487b6fb7fdbb901720cd4214f9179ed67 (diff) | |
| download | rust-06540cb205545e5e7e509933af27142ca35eae17.tar.gz rust-06540cb205545e5e7e509933af27142ca35eae17.zip | |
rustc: Enable #[thread_local] for Windows
I think LLVM has had support for quite some time now for this, we just never got around to testing it out and binding it. We've had some trouble landing this in the past I believe, but it's time to try again! This commit flags the `#[thread_local]` attribute as being available for Windows targets and adds an implementation of `register_dtor` in the `thread::local` module to ensure we can destroy these keys. The same functionality is implemented in clang via a function called `__tlregdtor` (presumably provided in some Windows runtime somewhere), but this function unfortunately does not take a data pointer (just a thunk) which means we can't easily call it. For now destructors are just run in the same way the Linux fallback is implemented, which is just keeping track via a single OS-based TLS key.
Diffstat (limited to 'src/libstd/sys/windows/mod.rs')
| -rw-r--r-- | src/libstd/sys/windows/mod.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libstd/sys/windows/mod.rs b/src/libstd/sys/windows/mod.rs index 4424c6c6136..840e7fdfc9b 100644 --- a/src/libstd/sys/windows/mod.rs +++ b/src/libstd/sys/windows/mod.rs @@ -26,6 +26,7 @@ pub mod condvar; pub mod dynamic_lib; pub mod env; pub mod ext; +pub mod fast_thread_local; pub mod fs; pub mod handle; pub mod memchr; |
