Conversation
|
I'm not totally confident about the new code in |
|
☔ The latest upstream changes (presumably #74726) made this pull request unmergeable. Please resolve the merge conflicts. |
|
cc #50699 ("Blocking Rayon queries") where r? @nikomatsakis |
|
Unfortunately #50699 has zero additional explanation beyond what is already in the code :( |
|
r=me with a rebase. |
We store an `ImplicitCtxt` pointer in a thread-local value (TLV). This allows implicit access to a `GlobalCtxt` and some other things. We also store a `GlobalCtxt` pointer in `GCX_PTR`. This is always the same `GlobalCtxt` as the one within the `ImplicitCtxt` pointer in TLV. `GCX_PTR` is only used in the parallel compiler's `handle_deadlock()` function. This commit does the following. - It removes `GCX_PTR`. - It also adds `ImplicitCtxt::new()`, which constructs an `ImplicitCtxt` from a `GlobalCtxt`. `ImplicitCtxt::new()` + `tls::enter_context()` is now equivalent to the old `tls::enter_global()`. - Makes `tls::get_tlv()` public for the parallel compiler, because it's now used in `handle_deadlock()`.
|
I have rebased. @bors r=Mark-Simulacrum |
|
📌 Commit 8c78fd2 has been approved by |
|
☀️ Test successful - checks-actions, checks-azure |
Add a `CurrentGcx` type to let the deadlock handler access `TyCtxt` This brings back `GCX_PTR` (previously removed in rust-lang#74969) allowing the deadlock handler access to `GlobalCtxt`. This fixes rust-lang#111522. r? `@cjgillot`
We store an
ImplicitCtxtpointer in a thread-local value (TLV). This allowsimplicit access to a
GlobalCtxtand some other things.We also store a
GlobalCtxtpointer inGCX_PTR. This is always the sameGlobalCtxtas the one within theImplicitCtxtpointer in TLV.GCX_PTRis only used in the parallel compiler's
handle_deadlock()function.This commit does the following.
GCX_PTR.ImplicitCtxt::new(), which constructs anImplicitCtxtfrom aGlobalCtxt.ImplicitCtxt::new()+tls::enter_context()is nowequivalent to the old
tls::enter_global().tls::get_tlv()public for the parallel compiler, because it'snow used in
handle_deadlock().r? @petrochenkov