Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b304272

Browse files
committedSep 9, 2023
Add a comment about the need of GCX_PTR
1 parent f4cecad commit b304272

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_middle/src/ty/context

1 file changed

+4
-0
lines changed
 

‎compiler/rustc_middle/src/ty/context/tls.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,5 +200,9 @@ impl GcxPtr {
200200
unsafe impl Sync for GcxPtr {}
201201

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

0 commit comments

Comments
 (0)
Please sign in to comment.