Skip to content

Commit

Permalink
Remove get_ManagedThreadId FCall (#91232)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo authored Aug 28, 2023
1 parent 00838f3 commit 4c01386
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@ public sealed partial class Thread

private Thread() { }

public extern int ManagedThreadId
public int ManagedThreadId
{
[Intrinsic]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
get => _managedThreadId;
}

/// <summary>Returns handle for interop with EE. The handle is guaranteed to be non-null.</summary>
Expand Down
11 changes: 0 additions & 11 deletions src/coreclr/vm/comsynchronizable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,17 +475,6 @@ FCIMPL1(void, ThreadNative::Sleep, INT32 iTime)
}
FCIMPLEND

FCIMPL1(INT32, ThreadNative::GetManagedThreadId, ThreadBaseObject* th) {
FCALL_CONTRACT;

FC_GC_POLL_NOT_NEEDED();
if (th == NULL)
FCThrow(kNullReferenceException);

return th->GetManagedThreadId();
}
FCIMPLEND

NOINLINE static Object* GetCurrentThreadHelper()
{
FCALL_CONTRACT;
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/vm/comsynchronizable.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ friend class ThreadBaseObject;
#endif // FEATURE_COMINTEROP_APARTMENT_SUPPORT


static FCDECL1(INT32, GetManagedThreadId, ThreadBaseObject* th);
static FCDECL0(INT32, GetOptimalMaxSpinWaitsPerSpinIteration);
static FCDECL1(void, SpinWait, int iterations);
static FCDECL0(Object*, GetCurrentThread);
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/vm/ecalllist.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ FCFuncStart(gThreadFuncs)
FCFuncElement("Initialize", ThreadNative::Initialize)
FCFuncElement("SpinWaitInternal", ThreadNative::SpinWait)
FCFuncElement("GetCurrentThreadNative", ThreadNative::GetCurrentThread)
FCFuncElement("get_ManagedThreadId", ThreadNative::GetManagedThreadId)
FCFuncElement("InternalFinalize", ThreadNative::Finalize)
FCFuncElement("get_IsAlive", ThreadNative::IsAlive)
FCFuncElement("IsBackgroundNative", ThreadNative::IsBackground)
Expand Down
6 changes: 0 additions & 6 deletions src/coreclr/vm/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -1343,12 +1343,6 @@ class ThreadBaseObject : public Object
void SetInternal(Thread *it);
void ClearInternal();

INT32 GetManagedThreadId()
{
LIMITED_METHOD_CONTRACT;
return m_ManagedThreadId;
}

void SetManagedThreadId(INT32 id)
{
LIMITED_METHOD_CONTRACT;
Expand Down

0 comments on commit 4c01386

Please sign in to comment.