-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Replace GetPalThreadIdForLogging() with GetOSThreadId() in NativeAOT #121322
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
Merged
+6
−6
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…orLogging Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Consider better implementation for ep_rt_aot_thread_get_id
Add GetOSThreadId() method for proper thread ID access in NativeAOT
Nov 3, 2025
Copilot finished work on behalf of
agocke
November 3, 2025 22:09
jkotas
reviewed
Nov 3, 2025
…adId Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot
AI
changed the title
Add GetOSThreadId() method for proper thread ID access in NativeAOT
Replace GetPalThreadIdForLogging() with GetOSThreadId() in NativeAOT
Nov 3, 2025
Copilot finished work on behalf of
jkotas
November 3, 2025 22:37
jkotas
reviewed
Nov 3, 2025
jkotas
approved these changes
Nov 3, 2025
Member
|
/ba-g timeouts |
Contributor
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.
Pull Request Overview
This PR renames the GetPalThreadIdForLogging method to GetOSThreadId in the NativeAOT runtime to improve naming consistency and clarity.
- The method name is changed from
GetPalThreadIdForLoggingtoGetOSThreadIdto better reflect its actual purpose and align with naming conventions used in the CoreCLR VM implementation. - All call sites across the NativeAOT runtime are updated to use the new method name.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/coreclr/nativeaot/Runtime/thread.h | Declaration of the method is renamed from GetPalThreadIdForLogging to GetOSThreadId |
| src/coreclr/nativeaot/Runtime/thread.cpp | Definition of the method is renamed, and call sites within STRESS_LOG macros are updated |
| src/coreclr/nativeaot/Runtime/gcenv.ee.cpp | Updated call site in GCToEEInterface::GetThreadOSThreadId to use the renamed method |
| src/coreclr/nativeaot/Runtime/eventpipe/ep-rt-aot.cpp | Updated call site in ep_rt_aot_thread_get_id to use the renamed method |
This was referenced Nov 4, 2025
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ep_rt_aot_thread_get_idand other call sites were usingGetPalThreadIdForLogging(), a method intended only for logging purposes, to retrieve thread IDs for EventPipe, GC, and stress logging functionality.Changes
Thread::GetOSThreadId()- New public method for proper thread ID access, aligning with CoreCLR'sGetOSThreadId64()patternThread::GetPalThreadIdForLogging()- Deleted the logging-specific method that was being misused for general purposesep_rt_aot_thread_get_id(),GCToEEInterface::GetThreadOSThreadId(), and stress logging calls to useGetOSThreadId()The new
GetOSThreadId()method returnsm_threadIdand provides proper semantics for all thread ID access needs.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.