Skip to content

Fix ThreadNameDoesNotAffectProcessName for Mono #35908

@lambdageek

Description

@lambdageek

See #34064

We need a check in mono_native_thread_set_name on Linux that the tid does not represent the main thread of the program (in the sense that on Linux gettid () == getpid () for the main thread).

The problem is that mono_native_thread_set_name gets a MonoNativeThreadId (which is pthread_t on Linux) and we need to compare that to the OS thread id of the main thread (which is a pid_t - gettid () of the main thread is the same as getpid()).

We have mono_native_thread_os_id_get () but it only returns the pid_t of the current thread - not of an arbitrary MonoNativeThreadId.

So we need some mechanism to go from a MonoNativeThreadId (or maybe a MonoThreadInfo) to a native OS thread id.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions