Skip to content

Commit

Permalink
Add a comment about the need of GCX_PTR
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Sep 9, 2023
1 parent f4cecad commit b304272
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/rustc_middle/src/ty/context/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,9 @@ impl GcxPtr {
unsafe impl Sync for GcxPtr {}

scoped_tls::scoped_thread_local! {
/// This is needed to allow the deadlock handler access to `GlobalCtxt` to look for query cycles.
/// It cannot use the `TLV` global is that's only guaranteed to be defined on the thread creating
/// the `GlobalCtxt`. Other thread have access to the `TLV` only inside Rayon jobs, but the
/// deadlock handler is not called inside such a job.
pub static GCX_PTR: GcxPtr
}

0 comments on commit b304272

Please sign in to comment.