-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std: make thread::current
available in all thread_local!
destructors
#127912
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
7dd342e
to
f4486ee
Compare
This comment has been minimized.
This comment has been minimized.
f4486ee
to
fa1cb86
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #127924) made this pull request unmergeable. Please resolve the merge conflicts. |
fa1cb86
to
4459a4f
Compare
The Miri subtree was changed cc @rust-lang/miri |
4459a4f
to
d6777a9
Compare
☔ The latest upstream changes (presumably #128213) made this pull request unmergeable. Please resolve the merge conflicts. |
Needs a rebase, but I think it looks ok, so @rustbot author |
d6777a9
to
cfbd250
Compare
T'was just a few imports and an @bors r=cupiver |
…cupiver std: make `thread::current` available in all `thread_local!` destructors ... and thereby allow the panic runtime to always print the right thread name. This works by modifying the TLS destructor system to schedule a runtime cleanup function after all other TLS destructors registered by `std` have run. Unfortunately, this doesn't affect foreign TLS destructors, `thread::current` will still panic there. Additionally, the thread ID returned by `current_id` will now always be available, even inside the global allocator, and will not change during the lifetime of one thread (this was previously the case with key-based TLS). The mechanisms I added for this (`local_pointer` and `thread_cleanup`) will also allow finally fixing rust-lang#111272 by moving the signal stack to a similar runtime-cleanup TLS variable.
…cupiver std: make `thread::current` available in all `thread_local!` destructors ... and thereby allow the panic runtime to always print the right thread name. This works by modifying the TLS destructor system to schedule a runtime cleanup function after all other TLS destructors registered by `std` have run. Unfortunately, this doesn't affect foreign TLS destructors, `thread::current` will still panic there. Additionally, the thread ID returned by `current_id` will now always be available, even inside the global allocator, and will not change during the lifetime of one thread (this was previously the case with key-based TLS). The mechanisms I added for this (`local_pointer` and `thread_cleanup`) will also allow finally fixing rust-lang#111272 by moving the signal stack to a similar runtime-cleanup TLS variable.
…kingjubilee Rollup of 9 pull requests Successful merges: - rust-lang#120221 (Don't make statement nonterminals match pattern nonterminals) - rust-lang#127912 (std: make `thread::current` available in all `thread_local!` destructors) - rust-lang#128166 (Improved `checked_isqrt` and `isqrt` methods) - rust-lang#129123 (rustdoc-json: Add test for `Self` type) - rust-lang#129366 (linker: Synchronize native library search in rustc and linker) - rust-lang#129527 (Don't use `TyKind` in a lint) - rust-lang#129534 (Deny `wasm_c_abi` lint to nudge the last 25%) - rust-lang#129640 (Re-enable android tests/benches in alloc/core) - rust-lang#129675 (allow BufReader::peek to be called on unsized types) r? `@ghost` `@rustbot` modify labels: rollup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
failed in #129729 (comment)
@bors r-
@bors r- |
☔ The latest upstream changes (presumably #129873) made this pull request unmergeable. Please resolve the merge conflicts. |
cfbd250
to
c22bc9f
Compare
☔ The latest upstream changes (presumably #130724) made this pull request unmergeable. Please resolve the merge conflicts. |
c22bc9f
to
b1e383b
Compare
... and thereby allow the panic runtime to always print the right thread name.
This works by modifying the TLS destructor system to schedule a runtime cleanup function after all other TLS destructors registered by
std
have run. Unfortunately, this doesn't affect foreign TLS destructors,thread::current
will still panic there.Additionally, the thread ID returned by
current_id
will now always be available, even inside the global allocator, and will not change during the lifetime of one thread (this was previously the case with key-based TLS).The mechanisms I added for this (
local_pointer
andthread_cleanup
) will also allow finally fixing #111272 by moving the signal stack to a similar runtime-cleanup TLS variable.