Delete unused fFullReset argument (#21814)
authorJan Kotas <jkotas@microsoft.com>
Fri, 4 Jan 2019 22:55:56 +0000 (14:55 -0800)
committerGitHub <noreply@github.com>
Fri, 4 Jan 2019 22:55:56 +0000 (14:55 -0800)
src/vm/comthreadpool.cpp
src/vm/finalizerthread.cpp
src/vm/nativeoverlapped.cpp
src/vm/threadpoolrequest.cpp
src/vm/threads.cpp
src/vm/threads.h
src/vm/win32threadpool.cpp

index c7492a4..11319e1 100644 (file)
@@ -262,7 +262,7 @@ FCIMPL0(FC_BOOL_RET, ThreadPoolNative::NotifyRequestComplete)
         }
 
         if (needReset)
-            pThread->InternalReset(FALSE, TRUE, TRUE, FALSE);
+            pThread->InternalReset(TRUE, TRUE, FALSE);
 
         HELPER_METHOD_FRAME_END();    
     }
index a9d94c5..f432571 100644 (file)
@@ -175,7 +175,7 @@ Object * FinalizerThread::DoOneFinalization(Object* fobj, Thread* pThread,int bi
                 CallFinalizer(fobj);
             }
         }
-        pThread->InternalReset(FALSE);
+        pThread->InternalReset();
     } 
     else 
     {
@@ -202,7 +202,7 @@ Object * FinalizerThread::DoOneFinalization(Object* fobj, Thread* pThread,int bi
                                                       &args,
                                                       pThreadTurnAround);
             }
-            pThread->InternalReset(FALSE);
+            pThread->InternalReset();
             // process the object we got back or be done if we got back null
             pReturnObject = OBJECTREFToObject(args.fobj);
             GCPROTECT_END();
index da4b572..9bb1190 100644 (file)
@@ -61,7 +61,7 @@ FCIMPL3(void, CheckVMForIOPacket, LPOVERLAPPED* lpOverlapped, DWORD* errorCode,
         if(!pThread->IsRealThreadPoolResetNeeded())
         {
             pThread->ResetManagedThreadObjectInCoopMode(ThreadNative::PRIORITY_NORMAL);
-            pThread->InternalReset(FALSE, TRUE, FALSE, FALSE);  
+            pThread->InternalReset(TRUE, FALSE, FALSE);  
             if(ThreadpoolMgr::ShouldGrowCompletionPortThreadpool(ThreadpoolMgr::CPThreadCounter.DangerousGetDirtyCounts()))
             {
                 //We may have to create a CP thread, go back to the Vm, and process the packet there.
index 66fe1f4..7bfb413 100644 (file)
@@ -563,7 +563,7 @@ void UnManagedPerAppDomainTPCount::DispatchWorkItem(bool* foundWork, bool* wasNo
             {
                 pThread->EEResetAbort(Thread::TAR_ALL);
             }
-            pThread->InternalReset(FALSE);
+            pThread->InternalReset();
         }
 
         endTime = GetTickCount();
index fa31676..1ba012a 100644 (file)
@@ -8771,30 +8771,6 @@ INT32 Thread::ResetManagedThreadObjectInCoopMode(INT32 nPriority)
     return nPriority;
 }
 
-void Thread::FullResetThread()
-{
-    CONTRACTL {
-        NOTHROW;
-        GC_TRIGGERS;
-    }
-    CONTRACTL_END;
-
-    GCX_COOP();
-
-    // We need to put this thread in COOPERATIVE GC first to solve race between AppDomain::Unload
-    // and Thread::Reset.  AppDomain::Unload does a full GC to collect all roots in one AppDomain.
-    // ThreadStaticData used to be coupled with a managed array of objects in the managed Thread
-    // object, however this is no longer the case.
-
-    // TODO: Do we still need to put this thread into COOP mode?
-
-    GCX_FORBID();
-    DeleteThreadStaticData();
-
-    m_alloc_context.alloc_bytes = 0;
-    m_fPromoted = FALSE;
-}
-
 BOOL Thread::IsRealThreadPoolResetNeeded()
 {
     CONTRACTL 
@@ -8822,7 +8798,7 @@ BOOL Thread::IsRealThreadPoolResetNeeded()
     return FALSE;
 }
 
-void Thread::InternalReset(BOOL fFull, BOOL fNotFinalizerThread, BOOL fThreadObjectResetNeeded, BOOL fResetAbort)
+void Thread::InternalReset(BOOL fNotFinalizerThread, BOOL fThreadObjectResetNeeded, BOOL fResetAbort)
 {
     CONTRACTL {
         NOTHROW;
@@ -8846,12 +8822,6 @@ void Thread::InternalReset(BOOL fFull, BOOL fNotFinalizerThread, BOOL fThreadObj
         nPriority = ResetManagedThreadObject(nPriority);
     }
 
-    if (fFull)
-    {
-        FullResetThread();
-    }
-
-
     //m_MarshalAlloc.Collapse(NULL);
 
     if (fResetAbort && IsAbortRequested()) {
index dbbb00b..e6e7cbf 100644 (file)
@@ -1317,13 +1317,10 @@ public:
     STDMETHODIMP EndPreventAsyncAbort()
         DAC_EMPTY_RET(E_FAIL);
 
-    void InternalReset (BOOL fFull, BOOL fNotFinalizerThread=FALSE, BOOL fThreadObjectResetNeeded=TRUE, BOOL fResetAbort=TRUE);
+    void InternalReset (BOOL fNotFinalizerThread=FALSE, BOOL fThreadObjectResetNeeded=TRUE, BOOL fResetAbort=TRUE);
     INT32 ResetManagedThreadObject(INT32 nPriority); 
     INT32 ResetManagedThreadObjectInCoopMode(INT32 nPriority);
     BOOL  IsRealThreadPoolResetNeeded();
-private:
-    //Helpers for reset...
-    void FullResetThread();
 public:
     HRESULT DetachThread(BOOL fDLLThreadDetach);
 
index 644e232..330dcff 100644 (file)
@@ -722,7 +722,7 @@ void QueueUserWorkItemHelp(LPTHREAD_START_ROUTINE Function, PVOID Context)
     if (pThread) {
         if (pThread->IsAbortRequested())
             pThread->EEResetAbort(Thread::TAR_ALL);
-        pThread->InternalReset(FALSE);
+        pThread->InternalReset();
     }
 }
 
@@ -2036,7 +2036,7 @@ Work:
         {
             if (pThread->IsAbortRequested())
                 pThread->EEResetAbort(Thread::TAR_ALL);
-            pThread->InternalReset(FALSE);
+            pThread->InternalReset();
         }
     }
 
@@ -3657,7 +3657,7 @@ Top:
                 if (pThread) {
                     if (pThread->IsAbortRequested())
                         pThread->EEResetAbort(Thread::TAR_ALL);
-                    pThread->InternalReset(FALSE);
+                    pThread->InternalReset();
                 }
             }
             else