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. |
4 | //***************************************************************************** |
5 | // File: DacDbiImplLocks.cpp |
6 | // |
7 | |
8 | // |
9 | // Implement DAC/DBI interface for testing our ability to detect when the LS |
10 | // holds a lock that we encounter while executing in the DAC. |
11 | // |
12 | //***************************************************************************** |
13 | |
14 | #include "stdafx.h" |
15 | #include "dacdbiinterface.h" |
16 | #include "holder.h" |
17 | #include "switches.h" |
18 | #include "dacdbiimpl.h" |
19 | |
20 | // ============================================================================ |
21 | // Functions to test data safety. In these functions we determine whether a lock |
22 | // is held in a code path we need to execute for inspection. If so, we throw an |
23 | // exception. |
24 | // ============================================================================ |
25 | |
26 | #ifdef TEST_DATA_CONSISTENCY |
27 | #include "crst.h" |
28 | |
29 | void DacDbiInterfaceImpl::TestCrst(VMPTR_Crst vmCrst) |
30 | { |
31 | DD_ENTER_MAY_THROW; |
32 | |
33 | DebugTryCrst(vmCrst.GetDacPtr()); |
34 | } |
35 | |
36 | void DacDbiInterfaceImpl::TestRWLock(VMPTR_SimpleRWLock vmRWLock) |
37 | { |
38 | DD_ENTER_MAY_THROW; |
39 | |
40 | DebugTryRWLock(vmRWLock.GetDacPtr()); |
41 | } |
42 | #endif |
43 | |
44 | |