Remove process object from PAL#128975
Open
huoyaoyuan wants to merge 10 commits into
Open
Conversation
am11
reviewed
Jun 4, 2026
jkotas
approved these changes
Jun 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the PAL “process object” (and its per-process local data) and drops session-ID tracking, simplifying PAL process-handle semantics to effectively only support the pseudo-handle for the current process.
Changes:
- Removed the PAL
otiProcessobject type /CProcProcessLocalDataand the initial-processIPalObjectbacking data. - Removed
gSID/GetCurrentSessionIdand stopped callinggetsid()during PAL init. - Updated
TerminateProcess/PROCEndProcessandDuplicateHandlepaths to treat the current-process pseudo-handle as the only supported “process handle” on Unix PAL.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/pal/src/thread/process.cpp | Removes process object backing data; changes process termination path to be current-process-only; removes session-id API. |
| src/coreclr/pal/src/init/pal.cpp | Stops initializing gSID (removes getsid(gPID)). |
| src/coreclr/pal/src/include/pal/procobj.hpp | Removes process-object declarations and CProcProcessLocalData type. |
| src/coreclr/pal/src/include/pal/process.h | Removes gSID and PROCGetProcessIDFromHandle declaration; updates comments. |
| src/coreclr/pal/src/include/pal/palinternal.h | Removes GetCurrentSessionId declaration. |
| src/coreclr/pal/src/include/pal/corunix.hpp | Removes otiProcess from PAL object type enum. |
| src/coreclr/pal/src/handlemgr/handleapi.cpp | Removes process-handle validation via process object; changes duplication behavior for pseudo process handle. |
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
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.
The pseudo handle for current process is still used by various api. There's no need to keep the object and ProcLocalData behind.