Skip to content

Commit 19da949

Browse files
authored
Delete dead code (#108265)
1 parent 79a71fc commit 19da949

File tree

3 files changed

+2
-46
lines changed

3 files changed

+2
-46
lines changed

src/coreclr/inc/corexcep.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,4 @@
2828
// stress to facilitate failure triaging.
2929
#endif
3030

31-
// This is the exception code to report SetupThread failure to caller of reverse pinvoke
32-
// It is misleading to use our COM+ exception code, since this is not a managed exception.
33-
// In the end, we picked e0455858 (EXX).
34-
#define EXCEPTION_EXX 0xe0455858 // 0xe0000000 | 'EXX'
3531
#endif // __COREXCEP_H__

src/coreclr/vm/threads.cpp

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -961,32 +961,6 @@ DWORD GetRuntimeId()
961961
#endif
962962
}
963963

964-
//---------------------------------------------------------------------------
965-
// Creates new Thread for reverse p-invoke calls.
966-
//---------------------------------------------------------------------------
967-
Thread* WINAPI CreateThreadBlockThrow()
968-
{
969-
970-
WRAPPER_NO_CONTRACT;
971-
972-
// This is a workaround to disable our check for throwing exception in SetupThread.
973-
// We want to throw an exception for reverse p-invoke, and our assertion may fire if
974-
// a unmanaged caller does not setup an exception handler.
975-
CONTRACT_VIOLATION(ThrowsViolation); // WON'T FIX - This enables catastrophic failure exception in reverse P/Invoke - the only way we can communicate an error to legacy code.
976-
977-
HRESULT hr = S_OK;
978-
Thread* pThread = SetupThreadNoThrow(&hr);
979-
if (pThread == NULL)
980-
{
981-
// Creating Thread failed, and we need to throw an exception to report status.
982-
// It is misleading to use our COM+ exception code, since this is not a managed exception.
983-
ULONG_PTR arg = hr;
984-
RaiseException(EXCEPTION_EXX, 0, 1, &arg);
985-
}
986-
987-
return pThread;
988-
}
989-
990964
#ifdef _DEBUG
991965
DWORD_PTR Thread::OBJREF_HASH = OBJREF_TABSIZE;
992966
#endif
@@ -2187,19 +2161,11 @@ BOOL Thread::CreateNewOSThread(SIZE_T sizeToCommitOrReserve, LPTHREAD_START_ROUT
21872161
// object. We also place a reference count on it when we construct it, and we lose
21882162
// that count when the thread finishes doing useful work (OnThreadTerminate).
21892163
//
2190-
// One way OnThreadTerminate() is called is when the thread finishes doing useful
2191-
// work. This case always happens on the correct thread.
2192-
//
2193-
// The other way OnThreadTerminate() is called is during product shutdown. We do
2194-
// a "best effort" to eliminate all threads except the Main thread before shutdown
2195-
// happens. But there may be some background threads or external threads still
2196-
// running.
2164+
// OnThreadTerminate() is called is when the thread finishes doing useful
2165+
// work.
21972166
//
21982167
// When the final reference count disappears, we destruct. Until then, the thread
21992168
// remains in the ThreadStore, but is marked as "Dead".
2200-
//<TODO>
2201-
// @TODO cwb: for a typical shutdown, only background threads are still around.
2202-
// Should we interrupt them? What about the non-typical shutdown?</TODO>
22032169

22042170
int Thread::IncExternalCount()
22052171
{

src/coreclr/vm/threads.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,6 @@ const CLONE_QUEUE_USER_APC_FLAGS SpecialUserModeApcWithContextFlags =
294294
// void DetachThread() - the underlying logical thread is going
295295
// away but we don't want to destroy it yet.
296296
//
297-
// Public functions for ASM code generators
298-
//
299-
// Thread* __stdcall CreateThreadBlockThrow() - creates new Thread on reverse p-invoke
300-
//
301297
// Public functions for one-time init/cleanup
302298
//
303299
// void InitThreadManager() - onetime init
@@ -337,8 +333,6 @@ void DestroyThread(Thread *th);
337333

338334
DWORD GetRuntimeId();
339335

340-
EXTERN_C Thread* WINAPI CreateThreadBlockThrow();
341-
342336
#define CREATETHREAD_IF_NULL_FAILFAST(__thread, __msg) \
343337
{ \
344338
HRESULT __ctinffhr; \

0 commit comments

Comments
 (0)