@@ -38,7 +38,7 @@ Module Name:
38
38
// We use the synchronization manager's worker thread to handle
39
39
// process termination requests. It does so by calling the
40
40
// registered handler function.
41
- PTERMINATION_REQUEST_HANDLER g_terminationRequestHandler = nullptr ;
41
+ PTERMINATION_REQUEST_HANDLER g_terminationRequestHandler = NULL ;
42
42
43
43
// Set the handler for process termination requests.
44
44
VOID PALAPI PAL_SetTerminationRequestHandler (
@@ -180,9 +180,9 @@ namespace CorUnix
180
180
Method:
181
181
CPalSynchronizationManager::BlockThread
182
182
183
- Call by a thread to go to sleep for a wait or a sleep
183
+ Called by a thread to go to sleep for a wait or a sleep
184
184
185
- NOTE: This methot must must be called without holding any
185
+ NOTE: This method must must be called without holding any
186
186
synchronization lock (as well as other locks)
187
187
--*/
188
188
PAL_ERROR CPalSynchronizationManager::BlockThread (
@@ -200,7 +200,7 @@ namespace CorUnix
200
200
DWORD dwSigObjIdx = 0 ;
201
201
bool fRaceAlerted = false ;
202
202
bool fEarlyDeath = false ;
203
-
203
+
204
204
pdwWaitState = SharedIDToTypePointer (DWORD,
205
205
pthrCurrent->synchronizationInfo .m_shridWaitAwakened );
206
206
@@ -234,7 +234,7 @@ namespace CorUnix
234
234
// native wait
235
235
fRaceAlerted = true ;
236
236
}
237
- }
237
+ }
238
238
239
239
if (!fRaceAlerted )
240
240
{
@@ -277,7 +277,7 @@ namespace CorUnix
277
277
}
278
278
}
279
279
280
- if (fAlertable )
280
+ if (fAlertable )
281
281
{
282
282
// Unlock
283
283
ReleaseSharedSynchLock (pthrCurrent);
@@ -486,7 +486,7 @@ namespace CorUnix
486
486
if (ETIMEDOUT == iWaitRet)
487
487
{
488
488
_ASSERT_MSG (INFINITE != dwTimeout,
489
- " Got a ETIMEDOUT despite timeout was INFINITE\n " );
489
+ " Got ETIMEDOUT despite timeout being INFINITE\n " );
490
490
break ;
491
491
}
492
492
else if (0 != iWaitRet)
@@ -529,7 +529,7 @@ namespace CorUnix
529
529
}
530
530
531
531
_ASSERT_MSG (ETIMEDOUT != iRet || INFINITE != dwTimeout,
532
- " Got time out return code with INFINITE timeout\n " );
532
+ " Got timeout return code with INFINITE timeout\n " );
533
533
534
534
if (0 == iWaitRet)
535
535
{
@@ -787,8 +787,8 @@ namespace CorUnix
787
787
rgObjects,
788
788
dwObjectCount,
789
789
(void **)rgControllers,
790
- CSynchControllerBase::WaitController);
791
- }
790
+ CSynchControllerBase::WaitController);
791
+ }
792
792
793
793
/* ++
794
794
Method:
@@ -808,7 +808,7 @@ namespace CorUnix
808
808
dwObjectCount,
809
809
(void **)rgControllers,
810
810
CSynchControllerBase::StateController);
811
- }
811
+ }
812
812
813
813
/* ++
814
814
Method:
@@ -1059,9 +1059,9 @@ namespace CorUnix
1059
1059
if (NULLSharedID == shridSynchData)
1060
1060
{
1061
1061
ERROR (" Unable to allocate shared memory\n " );
1062
- palErr = ERROR_NOT_ENOUGH_MEMORY;
1063
- goto AOSD_exit;
1062
+ return ERROR_NOT_ENOUGH_MEMORY;
1064
1063
}
1064
+
1065
1065
psdSynchData = SharedIDToTypePointer (CSynchData, shridSynchData);
1066
1066
1067
1067
VALIDATEOBJECT (psdSynchData);
@@ -1074,7 +1074,7 @@ namespace CorUnix
1074
1074
1075
1075
// Store shared pointer to this object
1076
1076
psdSynchData->SetSharedThis (shridSynchData);
1077
-
1077
+
1078
1078
*ppvSynchData = reinterpret_cast <void *>(shridSynchData);
1079
1079
}
1080
1080
else
@@ -1083,10 +1083,9 @@ namespace CorUnix
1083
1083
if (NULL == psdSynchData)
1084
1084
{
1085
1085
ERROR (" Unable to allocate memory\n " );
1086
- palErr = ERROR_NOT_ENOUGH_MEMORY;
1087
- goto AOSD_exit;
1086
+ return ERROR_NOT_ENOUGH_MEMORY;
1088
1087
}
1089
-
1088
+
1090
1089
// Initialize waiting list pointers
1091
1090
psdSynchData->SetWTLHeadPtr (NULL );
1092
1091
psdSynchData->SetWTLTailPtr (NULL );
@@ -1095,16 +1094,15 @@ namespace CorUnix
1095
1094
psdSynchData->SetSharedThis (NULLSharedID);
1096
1095
1097
1096
*ppvSynchData = static_cast <void *>(psdSynchData);
1098
- }
1097
+ }
1099
1098
1100
1099
// Initialize object domain and object type;
1101
1100
psdSynchData->SetObjectDomain (odObjectDomain);
1102
1101
psdSynchData->SetObjectType (potObjectType);
1103
1102
1104
- AOSD_exit:
1105
1103
return palErr;
1106
- }
1107
-
1104
+ }
1105
+
1108
1106
/* ++
1109
1107
Method:
1110
1108
CPalSynchronizationManager::FreeObjectSynchData
@@ -1127,10 +1125,11 @@ namespace CorUnix
1127
1125
{
1128
1126
psdSynchData = SharedIDToTypePointer (CSynchData,
1129
1127
reinterpret_cast <SharedID>(pvSynchData));
1128
+
1130
1129
if (NULL == psdSynchData)
1131
1130
{
1132
1131
ASSERT (" Bad shared memory pointer\n " );
1133
- goto FOSD_exit ;
1132
+ return ;
1134
1133
}
1135
1134
}
1136
1135
else
@@ -1139,9 +1138,6 @@ namespace CorUnix
1139
1138
}
1140
1139
1141
1140
psdSynchData->Release (pthrCurrent);
1142
-
1143
- FOSD_exit:
1144
- return ;
1145
1141
}
1146
1142
1147
1143
/* ++
@@ -1843,7 +1839,7 @@ namespace CorUnix
1843
1839
DWORD TerminationRequestHandlingRoutine (LPVOID pArg)
1844
1840
{
1845
1841
// Call the termination request handler if one is registered.
1846
- if (g_terminationRequestHandler != nullptr )
1842
+ if (g_terminationRequestHandler != NULL )
1847
1843
{
1848
1844
g_terminationRequestHandler ();
1849
1845
}
@@ -1890,7 +1886,7 @@ namespace CorUnix
1890
1886
case SynchWorkerCmdTerminationRequest:
1891
1887
// This worker thread is being asked to initiate process termination
1892
1888
1893
- HANDLE hShutdownThread ;
1889
+ HANDLE hTerminationRequestHandlingThread ;
1894
1890
palErr = InternalCreateThread (pthrWorker,
1895
1891
NULL ,
1896
1892
0 ,
@@ -1899,13 +1895,18 @@ namespace CorUnix
1899
1895
0 ,
1900
1896
PalWorkerThread,
1901
1897
NULL ,
1902
- &hShutdownThread );
1898
+ &hTerminationRequestHandlingThread );
1903
1899
1904
1900
if (NO_ERROR != palErr)
1905
1901
{
1906
1902
ERROR (" Unable to create worker thread\n " );
1907
1903
}
1908
1904
1905
+ if (hTerminationRequestHandlingThread != NULL )
1906
+ {
1907
+ CloseHandle (hTerminationRequestHandlingThread);
1908
+ }
1909
+
1909
1910
break ;
1910
1911
case SynchWorkerCmdNop:
1911
1912
TRACE (" Synch Worker: received SynchWorkerCmdNop\n " );
0 commit comments