1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
5 #ifndef __CRST_TYPES_INCLUDED
6 #define __CRST_TYPES_INCLUDED
8 // **** THIS IS AN AUTOMATICALLY GENERATED HEADER FILE -- DO NOT EDIT!!! ****
10 // This file describes the range of Crst types available and their mapping to a numeric level (used by the
11 // runtime in debug mode to validate we're deadlock free). To modify these settings edit the
12 // file:CrstTypes.def file and run the clr\bin\CrstTypeTool utility to generate a new version of this file.
14 // Each Crst type is declared as a value in the following CrstType enum.
18 CrstAppDomainCache = 1,
19 CrstAppDomainHandleTable = 2,
20 CrstArgBasedStubCache = 3,
21 CrstAssemblyDependencyGraph = 4,
22 CrstAssemblyIdentityCache = 5,
24 CrstAssemblyLoader = 7,
25 CrstAssemblyUsageLog = 8,
26 CrstAvailableClass = 9,
27 CrstAvailableParamTypes = 10,
31 CrstClassFactInfoHash = 14,
33 CrstClrNotification = 16,
34 CrstCLRPrivBinderMaps = 17,
35 CrstCLRPrivBinderMapsAdd = 18,
36 CrstCodeFragmentHeap = 19,
37 CrstCOMWrapperCache = 20,
38 CrstConnectionNameTable = 21,
40 CrstCoreCLRBinderLog = 23,
41 CrstCrstCLRPrivBinderLocalWinMDPath = 24,
45 CrstDbgTransport = 28,
46 CrstDeadlockDetection = 29,
47 CrstDebuggerController = 30,
48 CrstDebuggerFavorLock = 31,
49 CrstDebuggerHeapExecMemLock = 32,
50 CrstDebuggerHeapLock = 33,
51 CrstDebuggerJitInfo = 34,
52 CrstDebuggerMutex = 35,
53 CrstDelegateToFPtrHash = 36,
54 CrstDomainLocalBlock = 37,
57 CrstDynLinkZapItems = 40,
58 CrstEtwTypeLogHash = 41,
62 CrstExecuteManLock = 45,
63 CrstExecuteManRangeLock = 46,
65 CrstFriendAccessCache = 48,
66 CrstFuncPtrStubs = 49,
67 CrstFusionAppCtx = 50,
68 CrstFusionAssemblyDownload = 51,
69 CrstFusionBindContext = 52,
70 CrstFusionBindResult = 53,
72 CrstFusionClosure = 55,
73 CrstFusionClosureGraph = 56,
74 CrstFusionConfigSettings = 57,
75 CrstFusionDownload = 58,
76 CrstFusionIsoLibInit = 59,
77 CrstFusionLoadContext = 60,
79 CrstFusionNgenIndex = 62,
80 CrstFusionNgenIndexPool = 63,
81 CrstFusionPcyCache = 64,
82 CrstFusionPolicyConfigPool = 65,
83 CrstFusionSingleUse = 66,
84 CrstFusionWarningLog = 67,
85 CrstGCMemoryPressure = 68,
86 CrstGlobalStrLiteralMap = 69,
88 CrstHostAssemblyMap = 71,
89 CrstHostAssemblyMapAdd = 72,
91 CrstIJWFixupData = 74,
93 CrstILFingerprintCache = 76,
95 CrstInlineTrackingMap = 78,
96 CrstInstMethodHashTable = 79,
97 CrstInterfaceVTableMap = 80,
100 CrstIOThreadpoolWorker = 83,
101 CrstIsJMCMethod = 84,
102 CrstISymUnmanagedReader = 85,
104 CrstJitGenericHandleCache = 87,
106 CrstJumpStubCache = 89,
109 CrstLoaderAllocator = 92,
110 CrstLoaderAllocatorReferences = 93,
113 CrstMetadataTracker = 96,
114 CrstModIntPairList = 97,
116 CrstModuleFixup = 99,
117 CrstModuleLookupTable = 100,
118 CrstMulticoreJitHash = 101,
119 CrstMulticoreJitManager = 102,
120 CrstMUThunkHash = 103,
121 CrstNativeBinderInit = 104,
122 CrstNativeImageCache = 105,
124 CrstObjectList = 107,
125 CrstOnEventManager = 108,
126 CrstPatchEntryPoint = 109,
127 CrstPEFileSecurityManager = 110,
129 CrstPEImagePDBStream = 112,
130 CrstPendingTypeLoadEntry = 113,
132 CrstPinnedByrefValidation = 115,
133 CrstProfilerGCRefDataFreeList = 116,
134 CrstProfilingAPIStatus = 117,
135 CrstPublisherCertificate = 118,
137 CrstRCWCleanupList = 120,
138 CrstRCWRefCache = 121,
140 CrstReflection = 123,
141 CrstReJITDomainTable = 124,
142 CrstReJITGlobalRequest = 125,
143 CrstReJITSharedDomainTable = 126,
145 CrstRetThunkCache = 128,
147 CrstSavedExceptionInfo = 130,
148 CrstSaveModuleProfileData = 131,
149 CrstSecurityPolicyCache = 132,
150 CrstSecurityPolicyInit = 133,
151 CrstSecurityStackwalkCache = 134,
152 CrstSharedAssemblyCreate = 135,
153 CrstSharedBaseDomain = 136,
154 CrstSigConvert = 137,
155 CrstSingleUseLock = 138,
156 CrstSpecialStatics = 139,
157 CrstSqmManager = 140,
158 CrstStackSampler = 141,
160 CrstStrongName = 143,
162 CrstStubDispatchCache = 145,
163 CrstStubUnwindInfoHeapSegments = 146,
164 CrstSyncBlockCache = 147,
165 CrstSyncHashLock = 148,
166 CrstSystemBaseDomain = 149,
167 CrstSystemDomain = 150,
168 CrstSystemDomainDelayedUnloadList = 151,
169 CrstThreadIdDispenser = 152,
170 CrstThreadpoolEventCache = 153,
171 CrstThreadpoolTimerQueue = 154,
172 CrstThreadpoolWaitThreads = 155,
173 CrstThreadpoolWorker = 156,
174 CrstThreadStaticDataHashTable = 157,
175 CrstThreadStore = 158,
176 CrstTPMethodTable = 159,
177 CrstTypeEquivalenceMap = 160,
179 CrstUMEntryThunkCache = 162,
180 CrstUMThunkHash = 163,
181 CrstUniqueStack = 164,
182 CrstUnresolvedClassLock = 165,
183 CrstUnwindInfoTableLock = 166,
184 CrstVSDIndirectionCellLock = 167,
185 CrstWinRTFactoryCache = 168,
186 CrstWrapperTemplate = 169,
187 kNumberOfCrstTypes = 170
190 #endif // __CRST_TYPES_INCLUDED
192 // Define some debug data in one module only -- vm\crst.cpp.
193 #if defined(__IN_CRST_CPP) && defined(_DEBUG)
195 // An array mapping CrstType to level.
196 int g_rgCrstLevelMap[] =
198 9, // CrstAllowedFiles
199 9, // CrstAppDomainCache
200 13, // CrstAppDomainHandleTable
201 0, // CrstArgBasedStubCache
202 0, // CrstAssemblyDependencyGraph
203 0, // CrstAssemblyIdentityCache
204 0, // CrstAssemblyList
205 7, // CrstAssemblyLoader
206 0, // CrstAssemblyUsageLog
207 3, // CrstAvailableClass
208 6, // CrstAvailableParamTypes
212 11, // CrstClassFactInfoHash
214 -1, // CrstClrNotification
215 0, // CrstCLRPrivBinderMaps
216 3, // CrstCLRPrivBinderMapsAdd
217 6, // CrstCodeFragmentHeap
218 4, // CrstCOMWrapperCache
219 0, // CrstConnectionNameTable
221 -1, // CrstCoreCLRBinderLog
222 0, // CrstCrstCLRPrivBinderLocalWinMDPath
226 0, // CrstDbgTransport
227 0, // CrstDeadlockDetection
228 -1, // CrstDebuggerController
229 3, // CrstDebuggerFavorLock
230 0, // CrstDebuggerHeapExecMemLock
231 0, // CrstDebuggerHeapLock
232 4, // CrstDebuggerJitInfo
233 11, // CrstDebuggerMutex
234 0, // CrstDelegateToFPtrHash
235 15, // CrstDomainLocalBlock
238 3, // CrstDynLinkZapItems
239 7, // CrstEtwTypeLogHash
243 7, // CrstExecuteManLock
244 0, // CrstExecuteManRangeLock
246 7, // CrstFriendAccessCache
247 7, // CrstFuncPtrStubs
248 9, // CrstFusionAppCtx
249 7, // CrstFusionAssemblyDownload
250 5, // CrstFusionBindContext
251 0, // CrstFusionBindResult
253 16, // CrstFusionClosure
254 10, // CrstFusionClosureGraph
255 0, // CrstFusionConfigSettings
256 0, // CrstFusionDownload
257 0, // CrstFusionIsoLibInit
258 5, // CrstFusionLoadContext
260 7, // CrstFusionNgenIndex
261 7, // CrstFusionNgenIndexPool
262 0, // CrstFusionPcyCache
263 4, // CrstFusionPolicyConfigPool
264 5, // CrstFusionSingleUse
265 6, // CrstFusionWarningLog
266 0, // CrstGCMemoryPressure
267 11, // CrstGlobalStrLiteralMap
268 1, // CrstHandleTable
269 0, // CrstHostAssemblyMap
270 3, // CrstHostAssemblyMapAdd
272 9, // CrstIJWFixupData
274 5, // CrstILFingerprintCache
276 3, // CrstInlineTrackingMap
277 16, // CrstInstMethodHashTable
278 0, // CrstInterfaceVTableMap
280 4, // CrstInteropData
281 11, // CrstIOThreadpoolWorker
282 0, // CrstIsJMCMethod
283 7, // CrstISymUnmanagedReader
285 0, // CrstJitGenericHandleCache
287 6, // CrstJumpStubCache
290 14, // CrstLoaderAllocator
291 15, // CrstLoaderAllocatorReferences
294 -1, // CrstMetadataTracker
295 0, // CrstModIntPairList
297 14, // CrstModuleFixup
298 3, // CrstModuleLookupTable
299 0, // CrstMulticoreJitHash
300 11, // CrstMulticoreJitManager
301 0, // CrstMUThunkHash
302 -1, // CrstNativeBinderInit
303 -1, // CrstNativeImageCache
306 0, // CrstOnEventManager
307 0, // CrstPatchEntryPoint
308 0, // CrstPEFileSecurityManager
310 0, // CrstPEImagePDBStream
311 18, // CrstPendingTypeLoadEntry
313 0, // CrstPinnedByrefValidation
314 0, // CrstProfilerGCRefDataFreeList
315 0, // CrstProfilingAPIStatus
316 0, // CrstPublisherCertificate
318 0, // CrstRCWCleanupList
319 3, // CrstRCWRefCache
322 7, // CrstReJITDomainTable
323 13, // CrstReJITGlobalRequest
324 9, // CrstReJITSharedDomainTable
326 3, // CrstRetThunkCache
328 3, // CrstSavedExceptionInfo
329 0, // CrstSaveModuleProfileData
330 0, // CrstSecurityPolicyCache
331 3, // CrstSecurityPolicyInit
332 0, // CrstSecurityStackwalkCache
333 4, // CrstSharedAssemblyCreate
334 7, // CrstSharedBaseDomain
336 5, // CrstSingleUseLock
337 0, // CrstSpecialStatics
339 0, // CrstStackSampler
343 0, // CrstStubDispatchCache
344 4, // CrstStubUnwindInfoHeapSegments
345 3, // CrstSyncBlockCache
346 0, // CrstSyncHashLock
347 0, // CrstSystemBaseDomain
348 12, // CrstSystemDomain
349 0, // CrstSystemDomainDelayedUnloadList
350 0, // CrstThreadIdDispenser
351 0, // CrstThreadpoolEventCache
352 7, // CrstThreadpoolTimerQueue
353 7, // CrstThreadpoolWaitThreads
354 11, // CrstThreadpoolWorker
355 4, // CrstThreadStaticDataHashTable
356 10, // CrstThreadStore
357 9, // CrstTPMethodTable
358 3, // CrstTypeEquivalenceMap
360 3, // CrstUMEntryThunkCache
361 0, // CrstUMThunkHash
362 3, // CrstUniqueStack
363 7, // CrstUnresolvedClassLock
364 3, // CrstUnwindInfoTableLock
365 3, // CrstVSDIndirectionCellLock
366 3, // CrstWinRTFactoryCache
367 3, // CrstWrapperTemplate
370 // An array mapping CrstType to a stringized name.
371 LPCSTR g_rgCrstNameMap[] =
374 "CrstAppDomainCache",
375 "CrstAppDomainHandleTable",
376 "CrstArgBasedStubCache",
377 "CrstAssemblyDependencyGraph",
378 "CrstAssemblyIdentityCache",
380 "CrstAssemblyLoader",
381 "CrstAssemblyUsageLog",
382 "CrstAvailableClass",
383 "CrstAvailableParamTypes",
387 "CrstClassFactInfoHash",
389 "CrstClrNotification",
390 "CrstCLRPrivBinderMaps",
391 "CrstCLRPrivBinderMapsAdd",
392 "CrstCodeFragmentHeap",
393 "CrstCOMWrapperCache",
394 "CrstConnectionNameTable",
396 "CrstCoreCLRBinderLog",
397 "CrstCrstCLRPrivBinderLocalWinMDPath",
402 "CrstDeadlockDetection",
403 "CrstDebuggerController",
404 "CrstDebuggerFavorLock",
405 "CrstDebuggerHeapExecMemLock",
406 "CrstDebuggerHeapLock",
407 "CrstDebuggerJitInfo",
409 "CrstDelegateToFPtrHash",
410 "CrstDomainLocalBlock",
413 "CrstDynLinkZapItems",
414 "CrstEtwTypeLogHash",
418 "CrstExecuteManLock",
419 "CrstExecuteManRangeLock",
421 "CrstFriendAccessCache",
424 "CrstFusionAssemblyDownload",
425 "CrstFusionBindContext",
426 "CrstFusionBindResult",
429 "CrstFusionClosureGraph",
430 "CrstFusionConfigSettings",
431 "CrstFusionDownload",
432 "CrstFusionIsoLibInit",
433 "CrstFusionLoadContext",
435 "CrstFusionNgenIndex",
436 "CrstFusionNgenIndexPool",
437 "CrstFusionPcyCache",
438 "CrstFusionPolicyConfigPool",
439 "CrstFusionSingleUse",
440 "CrstFusionWarningLog",
441 "CrstGCMemoryPressure",
442 "CrstGlobalStrLiteralMap",
444 "CrstHostAssemblyMap",
445 "CrstHostAssemblyMapAdd",
449 "CrstILFingerprintCache",
451 "CrstInlineTrackingMap",
452 "CrstInstMethodHashTable",
453 "CrstInterfaceVTableMap",
456 "CrstIOThreadpoolWorker",
458 "CrstISymUnmanagedReader",
460 "CrstJitGenericHandleCache",
465 "CrstLoaderAllocator",
466 "CrstLoaderAllocatorReferences",
469 "CrstMetadataTracker",
470 "CrstModIntPairList",
473 "CrstModuleLookupTable",
474 "CrstMulticoreJitHash",
475 "CrstMulticoreJitManager",
477 "CrstNativeBinderInit",
478 "CrstNativeImageCache",
481 "CrstOnEventManager",
482 "CrstPatchEntryPoint",
483 "CrstPEFileSecurityManager",
485 "CrstPEImagePDBStream",
486 "CrstPendingTypeLoadEntry",
488 "CrstPinnedByrefValidation",
489 "CrstProfilerGCRefDataFreeList",
490 "CrstProfilingAPIStatus",
491 "CrstPublisherCertificate",
493 "CrstRCWCleanupList",
497 "CrstReJITDomainTable",
498 "CrstReJITGlobalRequest",
499 "CrstReJITSharedDomainTable",
503 "CrstSavedExceptionInfo",
504 "CrstSaveModuleProfileData",
505 "CrstSecurityPolicyCache",
506 "CrstSecurityPolicyInit",
507 "CrstSecurityStackwalkCache",
508 "CrstSharedAssemblyCreate",
509 "CrstSharedBaseDomain",
512 "CrstSpecialStatics",
518 "CrstStubDispatchCache",
519 "CrstStubUnwindInfoHeapSegments",
520 "CrstSyncBlockCache",
522 "CrstSystemBaseDomain",
524 "CrstSystemDomainDelayedUnloadList",
525 "CrstThreadIdDispenser",
526 "CrstThreadpoolEventCache",
527 "CrstThreadpoolTimerQueue",
528 "CrstThreadpoolWaitThreads",
529 "CrstThreadpoolWorker",
530 "CrstThreadStaticDataHashTable",
533 "CrstTypeEquivalenceMap",
535 "CrstUMEntryThunkCache",
538 "CrstUnresolvedClassLock",
539 "CrstUnwindInfoTableLock",
540 "CrstVSDIndirectionCellLock",
541 "CrstWinRTFactoryCache",
542 "CrstWrapperTemplate",
545 // Define a special level constant for unordered locks.
546 #define CRSTUNORDERED (-1)
548 // Define inline helpers to map Crst types to names and levels.
549 inline static int GetCrstLevel(CrstType crstType)
551 LIMITED_METHOD_CONTRACT;
552 _ASSERTE(crstType >= 0 && crstType < kNumberOfCrstTypes);
553 return g_rgCrstLevelMap[crstType];
555 inline static LPCSTR GetCrstName(CrstType crstType)
557 LIMITED_METHOD_CONTRACT;
558 _ASSERTE(crstType >= 0 && crstType < kNumberOfCrstTypes);
559 return g_rgCrstNameMap[crstType];
562 #endif // defined(__IN_CRST_CPP) && defined(_DEBUG)