Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Replace numeric thread id by an opaque one - #1002

Merged
janvorli merged 1 commit into
dotnet:masterfrom
janvorli:implement-pal-thread-id
Mar 10, 2016
Merged

janvorli merged 1 commit into
dotnet:masterfrom
janvorli:implement-pal-thread-id

Conversation

@janvorli

Copy link
Copy Markdown
Member

This change replaces usages of the uint thread id by EEThreadId at
places where we use it for thread matching. It also adds new
PAL function PalGetThreadIdForLogging that returns a numeric thread
id for logging purposes if the target platform supports it.
The reason for this change is that in pthreads, thread id is an
opaque struct and numeric id existence is platform specific.
Finally, I have changed the return value of the
GCToOSInterface::GetPalThreadIdForLogging to uint64_t so
that we can get and log the full id e.g. on OSX.

@janvorli

Copy link
Copy Markdown
Member Author

@smosier can you take a look please?

@janvorli

Copy link
Copy Markdown
Member Author

Hmm, it seems the GetCurrentThreadId is called from somewhere in the jit mode. I need to look into that.

This change replaces usages of the uint thread id by EEThreadId at
places where we use it for thread matching. It also adds new
PAL function GetPalThreadIdForLogging that returns a numeric thread
id for logging purposes if the target platform supports it.
The reason for this change is that in pthreads, thread id is an
opaque struct and numeric id existence is platform specific.
@janvorli
janvorli force-pushed the implement-pal-thread-id branch from 1e38669 to 9a04f2c Compare March 10, 2016 14:02
@janvorli

Copy link
Copy Markdown
Member Author

Fixed the problem - the GetCurrentThreadId was called by the SerializeExceptionsForDump in the src\System.Private.CoreLib\src\System\RuntimeExceptionHelpers.cs. I've created a throwing implementation in the src\Native\Bootstrap\platform.unix.cpp and I will fix the problem when I'll be working on the exception handling for Unix.

@smosier

smosier commented Mar 10, 2016

Copy link
Copy Markdown
Contributor

Looks good.

@janvorli

Copy link
Copy Markdown
Member Author

Implements part of #644

janvorli added a commit that referenced this pull request Mar 10, 2016
Replace numeric thread id by an opaque one
@janvorli
janvorli merged commit 654002d into dotnet:master Mar 10, 2016
@janvorli
janvorli deleted the implement-pal-thread-id branch March 10, 2016 17:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants