Skip to content

Remove process object from PAL#128975

Merged
jkotas merged 10 commits into
dotnet:mainfrom
huoyaoyuan:pal/process
Jun 6, 2026
Merged

Remove process object from PAL#128975
jkotas merged 10 commits into
dotnet:mainfrom
huoyaoyuan:pal/process

Conversation

@huoyaoyuan
Copy link
Copy Markdown
Member

The pseudo handle for current process is still used by various api. There's no need to keep the object and ProcLocalData behind.

@github-actions github-actions Bot added the area-PAL-coreclr only for closed issues label Jun 4, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jun 4, 2026
Comment thread src/coreclr/pal/src/thread/process.cpp
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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 otiProcess object type / CProcProcessLocalData and the initial-process IPalObject backing data.
  • Removed gSID / GetCurrentSessionId and stopped calling getsid() during PAL init.
  • Updated TerminateProcess / PROCEndProcess and DuplicateHandle paths 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.

Comment thread src/coreclr/pal/src/handlemgr/handleapi.cpp
Comment thread src/coreclr/pal/src/handlemgr/handleapi.cpp Outdated
Comment thread src/coreclr/pal/src/thread/process.cpp
@jkotas
Copy link
Copy Markdown
Member

jkotas commented Jun 6, 2026

/ba-g infrastructure timeouts

@jkotas jkotas merged commit 6b38e9b into dotnet:main Jun 6, 2026
110 of 113 checks passed
@huoyaoyuan huoyaoyuan deleted the pal/process branch June 6, 2026 14:25
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-PAL-coreclr only for closed issues community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants