Remove thread parameter from several more PAL functions.
authorAditya Mandaleeka <adityam@microsoft.com>
Sat, 7 Nov 2015 02:19:26 +0000 (18:19 -0800)
committerAditya Mandaleeka <adityam@microsoft.com>
Mon, 9 Nov 2015 23:44:46 +0000 (15:44 -0800)
12 files changed:
src/pal/src/file/find.cpp
src/pal/src/include/pal/corunix.hpp
src/pal/src/include/pal/procobj.hpp
src/pal/src/include/pal/synchobjects.hpp
src/pal/src/init/pal.cpp
src/pal/src/map/map.cpp
src/pal/src/misc/strutil.cpp
src/pal/src/objmgr/palobjbase.cpp
src/pal/src/synchmgr/synchmanager.cpp
src/pal/src/synchmgr/synchmanager.hpp
src/pal/src/thread/process.cpp
src/pal/src/thread/thread.cpp

index 80e9197..cdeb0ce 100644 (file)
@@ -43,7 +43,6 @@ SET_DEFAULT_DEBUG_CHANNEL(FILE);
 namespace CorUnix
 {
     int InternalGlob(
-        CPalThread *pthrCurrent,
         const char *szPattern,
         int nFlags,
 #if ERROR_FUNC_FOR_GLOB_HAS_FIXED_PARAMS    
@@ -59,7 +58,6 @@ namespace CorUnix
 
     Input parameters:
 
-    pthrCurrent = reference to executing thread
     szPattern = pointer to a pathname pattern to be expanded
     nFlags = arguments to modify the behavior of glob
     pnErrFunc = pointer to a routine that handles errors during the glob call
@@ -76,7 +74,6 @@ namespace CorUnix
     --*/
     int
     InternalGlob(
-        CPalThread *pthrCurrent,
         const char *szPattern,
         int nFlags,
 #if ERROR_FUNC_FOR_GLOB_HAS_FIXED_PARAMS
@@ -102,7 +99,6 @@ static BOOL FILEDosGlobA(
 static int FILEGlobQsortCompare(const void *in_str1, const void *in_str2);
 
 static int FILEGlobFromSplitPath( 
-        CPalThread *pthrCurrent,
         const char *dir,
         const char *fname,
         const char *ext,
@@ -767,8 +763,7 @@ in broken-down form like _splitpath produces.
 ie. calling splitpath on a pattern then calling this function should
 produce the same result as just calling glob() on the pattern.
 --*/
-static int FILEGlobFromSplitPath( CPalThread *pthrCurrent,
-                                  const char *dir,
+static int FILEGlobFromSplitPath( const char *dir,
                                   const char *fname,
                                   const char *ext,
                                   int flags, 
@@ -811,7 +806,7 @@ static int FILEGlobFromSplitPath( CPalThread *pthrCurrent,
 #ifdef GLOB_QUOTE
     flags |= GLOB_QUOTE;
 #endif  // GLOB_QUOTE
-    Ret = InternalGlob(pthrCurrent, EscapedPattern, flags, NULL, pgGlob);
+    Ret = InternalGlob(EscapedPattern, flags, NULL, pgGlob);
 
 #ifdef GLOB_NOMATCH
     if (Ret == GLOB_NOMATCH)
@@ -950,7 +945,7 @@ static BOOL FILEDosGlobA( CPalThread *pthrCurrent,
     if ( !(A && B) ) 
     {
         /* the original pattern */
-        globResult = FILEGlobFromSplitPath(pthrCurrent, Dir, Filename, Ext, 0, pgGlob);
+        globResult = FILEGlobFromSplitPath(Dir, Filename, Ext, 0, pgGlob);
         if ( globResult != 0 )
         {
             goto done;
@@ -959,7 +954,7 @@ static BOOL FILEDosGlobA( CPalThread *pthrCurrent,
         if (C)
         {
             /* the original pattern but '.' prepended to filename */
-            globResult = FILEGlobFromSplitPath(pthrCurrent, Dir, Filename - 1, Ext,
+            globResult = FILEGlobFromSplitPath(Dir, Filename - 1, Ext,
                                                GLOB_APPEND, pgGlob);
             if ( globResult != 0 )
             {
@@ -973,7 +968,7 @@ static BOOL FILEDosGlobA( CPalThread *pthrCurrent,
         /* if (A && B), this is the first glob() call. The first call
            to glob must use flags = 0, while proceeding calls should
            set the GLOB_APPEND flag. */
-        globResult = FILEGlobFromSplitPath(pthrCurrent, Dir, Filename, "",
+        globResult = FILEGlobFromSplitPath(Dir, Filename, "",
                                            (A && B)?0:GLOB_APPEND, pgGlob);
         if ( globResult != 0 )
         {
@@ -983,7 +978,7 @@ static BOOL FILEDosGlobA( CPalThread *pthrCurrent,
         if (C)
         {
             /* omit the extension and prepend '.' to filename */
-            globResult = FILEGlobFromSplitPath(pthrCurrent, Dir, Filename - 1, "",
+            globResult = FILEGlobFromSplitPath(Dir, Filename - 1, "",
                                                GLOB_APPEND, pgGlob);
             if ( globResult != 0 )
             {
index 96a8d68..aa2af36 100644 (file)
@@ -107,9 +107,7 @@ namespace CorUnix
             );
 
         void
-        FreeBuffer(
-            CPalThread *pthr
-            );            
+        FreeBuffer();
 
         const WCHAR *
         GetString()
index 10ed932..8500fd1 100644 (file)
@@ -114,7 +114,6 @@ namespace CorUnix
 
     PAL_ERROR
     InitializeProcessCommandLine(
-        CPalThread *pThread,
         LPWSTR lpwstrCmdLine,
         LPWSTR lpwstrFullPath
         );
index ea0e2d3..6c78b3c 100644 (file)
@@ -168,7 +168,7 @@ namespace CorUnix
         }
 
 #if SYNCHMGR_SUSPENSION_SAFE_CONDITION_SIGNALING && !SYNCHMGR_PIPE_BASED_THREAD_BLOCKING
-        PAL_ERROR RunDeferredThreadConditionSignalings(CPalThread * pthrCurrent);
+        PAL_ERROR RunDeferredThreadConditionSignalings();
 #endif // SYNCHMGR_SUSPENSION_SAFE_CONDITION_SIGNALING && !SYNCHMGR_PIPE_BASED_THREAD_BLOCKING
     
         // NOTE: the following methods provide non-synchronized access to 
@@ -205,8 +205,7 @@ namespace CorUnix
     class CPalSynchMgrController
     {
     public:
-        static IPalSynchronizationManager * CreatePalSynchronizationManager(
-            CPalThread * pthrCurrent);
+        static IPalSynchronizationManager * CreatePalSynchronizationManager();
 
         static PAL_ERROR StartWorker(CPalThread * pthrCurrent);
 
index 00ce814..15ecae6 100644 (file)
@@ -378,7 +378,7 @@ Initialize(
         // Initialize the synchronization manager
         //
         g_pSynchronizationManager =
-            CPalSynchMgrController::CreatePalSynchronizationManager(pThread);
+            CPalSynchMgrController::CreatePalSynchronizationManager();
 
         if (NULL == g_pSynchronizationManager)
         {
@@ -419,7 +419,6 @@ Initialize(
         }
 
         palError = InitializeProcessCommandLine(
-            pThread,
             command_line,
             exe_path);
         
index ea59b71..dd87c2b 100644 (file)
@@ -80,7 +80,6 @@ static PMAPPED_VIEW_LIST FindSharedMappingReplacement(CPalThread *pThread, dev_t
 
 static PAL_ERROR
 MAPRecordMapping(
-    CPalThread *pThread,
     IPalObject *pMappingObject,
     void *pPEBaseAddress,
     void *addr,
@@ -90,7 +89,6 @@ MAPRecordMapping(
 
 static PAL_ERROR
 MAPmmapAndRecord(
-    CPalThread *pThread,
     IPalObject *pMappingObject,
     void *pPEBaseAddress,
     void *addr,
@@ -2185,7 +2183,6 @@ static LONG NativeMapHolderRelease(CPalThread *pThread, NativeMapHolder * thisNM
 // This call assumes the mapping_critsec has already been taken.
 static PAL_ERROR
 MAPRecordMapping(
-    CPalThread *pThread,
     IPalObject *pMappingObject,
     void *pPEBaseAddress,
     void *addr,
@@ -2225,7 +2222,6 @@ MAPRecordMapping(
 // This call assumes the mapping_critsec has already been taken.
 static PAL_ERROR
 MAPmmapAndRecord(
-    CPalThread *pThread,
     IPalObject *pMappingObject,
     void *pPEBaseAddress,
     void *addr,
@@ -2250,7 +2246,7 @@ MAPmmapAndRecord(
     }
     else
     {
-        palError = MAPRecordMapping(pThread, pMappingObject, pPEBaseAddress, pvBaseAddress, len, prot);
+        palError = MAPRecordMapping(pMappingObject, pPEBaseAddress, pvBaseAddress, len, prot);
         if (NO_ERROR != palError)
         {
             if (-1 == munmap(pvBaseAddress, len))
@@ -2475,7 +2471,7 @@ void * MAPMapPEFile(HANDLE hFile)
     headerSize = VIRTUAL_PAGE_SIZE; // if there are lots of sections, this could be wrong
 
     //first, map the PE header to the first page in the image.  Get pointers to the section headers
-    palError = MAPmmapAndRecord(pThread, pFileObject, loadedBase,
+    palError = MAPmmapAndRecord(pFileObject, loadedBase,
                     loadedBase, headerSize, PROT_READ, MAP_FILE|MAP_PRIVATE|MAP_FIXED, fd, 0,
                     (void**)&loadedHeader);
     if (NO_ERROR != palError)
@@ -2543,7 +2539,7 @@ void * MAPMapPEFile(HANDLE hFile)
         if ((char*)prevSectionBase + prevSectionSizeInMemory < sectionBase)
         {
             char* gapBase = (char*)prevSectionBase + prevSectionSizeInMemory;
-            palError = MAPRecordMapping(pThread, pFileObject,
+            palError = MAPRecordMapping(pFileObject,
                             loadedBase,
                             (void*)gapBase,
                             (char*)sectionBase - gapBase,
@@ -2565,7 +2561,7 @@ void * MAPMapPEFile(HANDLE hFile)
         if (currentHeader.Characteristics & IMAGE_SCN_MEM_WRITE)
             prot |= PROT_WRITE;
 
-        palError = MAPmmapAndRecord(pThread, pFileObject, loadedBase,
+        palError = MAPmmapAndRecord(pFileObject, loadedBase,
                         sectionBase,
                         currentHeader.SizeOfRawData,
                         prot,
@@ -2600,7 +2596,7 @@ void * MAPMapPEFile(HANDLE hFile)
     if ((char*)prevSectionBase + prevSectionSizeInMemory < imageEnd)
     {
         char* gapBase = (char*)prevSectionBase + prevSectionSizeInMemory;
-        palError = MAPRecordMapping(pThread, pFileObject,
+        palError = MAPRecordMapping(pFileObject,
                         loadedBase,
                         (void*)gapBase,
                         imageEnd - gapBase,
index e0f2cb2..10aa6d1 100644 (file)
@@ -87,16 +87,11 @@ Function:
 
   Frees the contained string buffer
 
-Parameters:
-  pthr -- thread data for calling thread
 --*/
 
 void
-CPalString::FreeBuffer(
-    CPalThread *pthr
-    )
+CPalString::FreeBuffer()
 {
     _ASSERTE(NULL != m_pwsz);
-    
     InternalFree(const_cast<WCHAR*>(m_pwsz));
 }
index 63e0f86..5e45106 100644 (file)
@@ -340,11 +340,6 @@ CPalObjectBase::~CPalObjectBase()
 {
     ENTRY("CPalObjectBase::~CPalObjectBase(this = %p)\n", this);
 
-    // There is no need to call InternalGetCurrentThread here because
-    // ReleaseReference already stores the thread object that
-    // deletes this object in m_pthrCleanup to make sure the
-    // thread object is alive throughout the object cleanup process.
-
     if (NULL != m_pvImmutableData)
     {
         InternalFree(m_pvImmutableData);
@@ -357,7 +352,7 @@ CPalObjectBase::~CPalObjectBase()
 
     if (NULL != m_oa.sObjectName.GetString())
     {
-        m_oa.sObjectName.FreeBuffer(m_pthrCleanup);
+        m_oa.sObjectName.FreeBuffer();
     }
 
     LOGEXIT("CPalObjectBase::~CPalObjectBase\n");
index 0adbb3d..5408d93 100644 (file)
@@ -94,10 +94,9 @@ namespace CorUnix
 
     Creates the Synchronization Manager. It must be called once per process.
     --*/
-    IPalSynchronizationManager * CPalSynchMgrController::CreatePalSynchronizationManager(
-        CPalThread *pthrCurrent)
+    IPalSynchronizationManager * CPalSynchMgrController::CreatePalSynchronizationManager()
     { 
-        return CPalSynchronizationManager::CreatePalSynchronizationManager(pthrCurrent);
+        return CPalSynchronizationManager::CreatePalSynchronizationManager();
     };
 
     /*++
@@ -1474,13 +1473,12 @@ namespace CorUnix
     Creates the Synchronization Manager.
     Private method, it is called only by CPalSynchMgrController.
     --*/
-    IPalSynchronizationManager * CPalSynchronizationManager::CreatePalSynchronizationManager(
-        CPalThread *pthrCurrent)
+    IPalSynchronizationManager * CPalSynchronizationManager::CreatePalSynchronizationManager()
     { 
-        IPalSynchronizationManager * pRet = NULL;    
+        IPalSynchronizationManager * pRet = NULL;
         if (s_pObjSynchMgr == NULL)
         {
-            Initialize(pthrCurrent);
+            Initialize();
             pRet = static_cast<IPalSynchronizationManager *>(s_pObjSynchMgr);
         }
         else
@@ -1497,9 +1495,8 @@ namespace CorUnix
 
     Internal Synchronization Manager initialization
     --*/
-    PAL_ERROR CPalSynchronizationManager::Initialize(
-        CPalThread *pthrCurrent)
-    {        
+    PAL_ERROR CPalSynchronizationManager::Initialize()
+    {
         PAL_ERROR palErr = NO_ERROR;
         LONG lInit;
         CPalSynchronizationManager * pSynchManager = NULL;
@@ -1525,7 +1522,7 @@ namespace CorUnix
             goto I_exit;
         }
 
-        if (!pSynchManager->CreateProcessPipe(pthrCurrent))
+        if (!pSynchManager->CreateProcessPipe())
         {
             ERROR("Unable to create process pipe \n");
             palErr = ERROR_OPEN_FAILED;
@@ -1535,8 +1532,8 @@ namespace CorUnix
         s_pObjSynchMgr = pSynchManager;
 
         // Initialization was successful
-        g_pSynchronizationManager = 
-            static_cast<IPalSynchronizationManager *>(pSynchManager);                    
+        g_pSynchronizationManager =
+            static_cast<IPalSynchronizationManager *>(pSynchManager);
         s_lInitStatus = (LONG)SynchMgrStatusRunning;
         
     I_exit:
@@ -1545,7 +1542,7 @@ namespace CorUnix
             s_lInitStatus = (LONG)SynchMgrStatusError;
             if (NULL != pSynchManager)
             {
-                pSynchManager->ShutdownProcessPipe(pthrCurrent);
+                pSynchManager->ShutdownProcessPipe();
             }
             s_pObjSynchMgr = NULL;
             g_pSynchronizationManager = NULL;
@@ -1648,13 +1645,13 @@ namespace CorUnix
                    SynchMgrStatusRunning, lInit);
             // We intentionally not set s_lInitStatus to SynchMgrStatusError
             // cause this could interfere with a previous thread already 
-            // executing shutdown            
+            // executing shutdown
             palErr = ERROR_INTERNAL_ERROR;
             goto PFS_exit;
         }
 
         // Discard process monitoring for process waits
-        pSynchManager->DiscardMonitoredProcesses(pthrCurrent);        
+        pSynchManager->DiscardMonitoredProcesses(pthrCurrent);
 
         if (NULL == pSynchManager->m_pipoThread)
         {
@@ -1663,10 +1660,9 @@ namespace CorUnix
             // sometime after having called CreatePalSynchronizationManager,
             // but before calling StartWorker. Nothing else to do here.
             goto PFS_exit;
-        }            
+        }
 
-        palErr = pSynchManager->WakeUpLocalWorkerThread(pthrCurrent, 
-                                                        SynchWorkerCmdShutdown);
+        palErr = pSynchManager->WakeUpLocalWorkerThread(SynchWorkerCmdShutdown);
         if (NO_ERROR != palErr)
         {
             ERROR("Failed stopping worker thread [palErr=%u]\n", palErr);
@@ -1684,7 +1680,7 @@ namespace CorUnix
             ERROR("Failed to convert timeout to absolute timeout\n");
             s_lInitStatus = SynchMgrStatusError;
             goto PFS_exit;
-        }            
+        }
 
         // Using the worker thread's predicate/condition/mutex
         // to wait for worker thread to be done
@@ -2040,7 +2036,7 @@ namespace CorUnix
                     // be read). That will allow the worker thread to process 
                     // possible commands already successfully written to the 
                     // pipe by some other process, before shutting down.
-                    pSynchManager->ShutdownProcessPipe(pthrWorker);
+                    pSynchManager->ShutdownProcessPipe();
 
                     // Shutting down: this will cause the worker thread to
                     // fetch residual cmds from the process pipe until an
@@ -2959,7 +2955,6 @@ namespace CorUnix
     process pipe.
     --*/
     PAL_ERROR CPalSynchronizationManager::WakeUpLocalWorkerThread(
-        CPalThread * pthrCurrent,
         SynchWorkerCmd swcWorkerCmd)
     {
         PAL_ERROR palErr = NO_ERROR;
@@ -3407,8 +3402,7 @@ namespace CorUnix
         {
             CPalSynchronizationManager * pSynchManager = GetInstance();
 
-            palErr = pSynchManager->WakeUpLocalWorkerThread(pthrCurrent, 
-                                                            SynchWorkerCmdNop);
+            palErr = pSynchManager->WakeUpLocalWorkerThread(SynchWorkerCmdNop);
             if (NO_ERROR != palErr)
             {
                 ERROR("Failed waking up worker thread for process "
@@ -3750,8 +3744,7 @@ namespace CorUnix
 
     Creates the process pipe for the current process
     --*/
-    bool CPalSynchronizationManager::CreateProcessPipe(
-        CPalThread * pthrCurrent)
+    bool CPalSynchronizationManager::CreateProcessPipe()
     {
         bool fRet = true;
 #if HAVE_KQUEUE && !HAVE_BROKEN_FIFO_KEVENT
@@ -3892,14 +3885,13 @@ namespace CorUnix
 
     Shuts down the process pipe and removes the fifo so that other processes
     can no longer open it. It also closes the local write end of the pipe (see
-    comment below). From this moment on the worker thread will process any 
+    comment below). From this moment on the worker thread will process any
     possible data already received in the pipe (but not yet consumed) and any
-    data written by processes that still have a opened write end of this pipe; 
+    data written by processes that still have a opened write end of this pipe;
     it will wait (with timeout) until the last remote process which has a write
-    end opened closes it, and then it will yield to process shutdown    
+    end opened closes it, and then it will yield to process shutdown.
     --*/
-    PAL_ERROR CPalSynchronizationManager::ShutdownProcessPipe(
-        CPalThread *pthrCurrent)
+    PAL_ERROR CPalSynchronizationManager::ShutdownProcessPipe()
     {
         PAL_ERROR palErr = NO_ERROR;
 #ifndef CORECLR
@@ -4580,8 +4572,7 @@ namespace CorUnix
 
     Carries out all the pending condition signalings for the current thread.
     --*/
-    PAL_ERROR CThreadSynchronizationInfo::RunDeferredThreadConditionSignalings(
-        CPalThread * pthrCurrent)
+    PAL_ERROR CThreadSynchronizationInfo::RunDeferredThreadConditionSignalings()
     {
         PAL_ERROR palErr = NO_ERROR;
 
index 0e9fe14..5a690e6 100644 (file)
@@ -587,7 +587,7 @@ namespace CorUnix
         COwnedObjectsListNodeCache      m_cacheOwnedObjectsListNodes;
 
         // static methods
-        static PAL_ERROR Initialize(CPalThread * pthrCurrent);
+        static PAL_ERROR Initialize();
         static DWORD PALAPI WorkerThread(LPVOID pArg);
 
     protected:
@@ -601,8 +601,7 @@ namespace CorUnix
             CSynchControllerBase::ControllerType ctCtrlrType);
 
     private:
-        static IPalSynchronizationManager * CreatePalSynchronizationManager(
-            CPalThread * pthrCurrent);
+        static IPalSynchronizationManager * CreatePalSynchronizationManager();
         static PAL_ERROR StartWorker(CPalThread * pthrCurrent);
         static PAL_ERROR PrepareForShutdown(void);
 
@@ -637,7 +636,7 @@ namespace CorUnix
                 InternalLeaveCriticalSection(pthrCurrent, &s_csSynchProcessLock);
                 
 #if SYNCHMGR_SUSPENSION_SAFE_CONDITION_SIGNALING && !SYNCHMGR_PIPE_BASED_THREAD_BLOCKING
-                pthrCurrent->synchronizationInfo.RunDeferredThreadConditionSignalings(pthrCurrent);
+                pthrCurrent->synchronizationInfo.RunDeferredThreadConditionSignalings();
 #endif // SYNCHMGR_SUSPENSION_SAFE_CONDITION_SIGNALING && !SYNCHMGR_PIPE_BASED_THREAD_BLOCKING
             }
         }
@@ -652,14 +651,14 @@ namespace CorUnix
                 InternalLeaveCriticalSection(pthrCurrent, &s_csSynchProcessLock);
 
 #if SYNCHMGR_SUSPENSION_SAFE_CONDITION_SIGNALING && !SYNCHMGR_PIPE_BASED_THREAD_BLOCKING
-                pthrCurrent->synchronizationInfo.RunDeferredThreadConditionSignalings(pthrCurrent);
+                pthrCurrent->synchronizationInfo.RunDeferredThreadConditionSignalings();
 #endif // SYNCHMGR_SUSPENSION_SAFE_CONDITION_SIGNALING && !SYNCHMGR_PIPE_BASED_THREAD_BLOCKING
             }            
             return lRet;
         }
         static LONG GetLocalSynchLockCount(CPalThread * pthrCurrent) 
         {
-            _ASSERTE(0 <= pthrCurrent->synchronizationInfo.m_lLocalSynchLockCount);            
+            _ASSERTE(0 <= pthrCurrent->synchronizationInfo.m_lLocalSynchLockCount);
             return pthrCurrent->synchronizationInfo.m_lLocalSynchLockCount;
         }
 
@@ -962,7 +961,6 @@ namespace CorUnix
             DWORD * pdwData);
 
         PAL_ERROR WakeUpLocalWorkerThread(
-            CPalThread * pthrCurrent,
             SynchWorkerCmd swcWorkerCmd);
 
         void DiscardAllPendingAPCs(
@@ -974,9 +972,9 @@ namespace CorUnix
             BYTE * pRecvBuf,
             LONG lBytes);
 
-        bool CreateProcessPipe(CPalThread * pthrCurrent);
+        bool CreateProcessPipe();
 
-        PAL_ERROR ShutdownProcessPipe(CPalThread * pthrCurrent);
+        PAL_ERROR ShutdownProcessPipe();
 
     public:
         //
index 72c422a..88a265b 100644 (file)
@@ -2313,7 +2313,6 @@ Abstract
     Initializes (or re-initializes) the saved command line and exe path.
 
 Parameter
-    pThread - the initial thread
     lpwstrCmdLine
     lpwstrFullPath
  
@@ -2326,7 +2325,6 @@ Notes
 
 PAL_ERROR
 CorUnix::InitializeProcessCommandLine(
-    CPalThread *pThread,
     LPWSTR lpwstrCmdLine,
     LPWSTR lpwstrFullPath
 )
index 352f240..73504a9 100644 (file)
@@ -214,7 +214,7 @@ Abstract:
 Return:
     The fresh thread structure, NULL otherwise
 --*/
-CPalThread* AllocTHREAD(CPalThread *pthr)
+CPalThread* AllocTHREAD()
 {
     CPalThread* pThread = NULL;
 
@@ -574,7 +574,7 @@ CorUnix::InternalCreateThread(
     // Create the CPalThread for the thread
     //
 
-    pNewThread = AllocTHREAD(pThread);
+    pNewThread = AllocTHREAD();
     if (NULL == pNewThread)
     {
         palError = ERROR_OUTOFMEMORY;
@@ -1613,8 +1613,7 @@ CorUnix::CreateThreadData(
     CPalThread *pThread = NULL;
     
     /* Create the thread object */
-    /* Passing NULL to AllocTHREAD since there is no thread reference to pass in. */
-    pThread = AllocTHREAD(NULL);
+    pThread = AllocTHREAD();
 
     if (NULL == pThread)
     {
@@ -1830,7 +1829,7 @@ CorUnix::InternalCreateDummyThread(
     CObjectAttributes oa(NULL, lpThreadAttributes);
     bool fThreadDataStoredInObject = FALSE;
 
-    pDummyThread = AllocTHREAD(pThread);
+    pDummyThread = AllocTHREAD();
     if (NULL == pDummyThread)
     {
         palError = ERROR_OUTOFMEMORY;