blob: cd40c020d8cc89d202714066d0fd556eb1cb5430 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
// ===========================================================================
//
//
// File: ListLock.inl
//
// ===========================================================================
// This file decribes the list lock and deadlock aware list lock functions
// that are inlined but can't go in the header.
// ===========================================================================
#ifndef LISTLOCK_INL
#define LISTLOCK_INL
#include "listlock.h"
#include "dbginterface.h"
// Must own the lock before calling this or is ok if the debugger has
// all threads stopped
inline ListLockEntry *ListLock::Find(void *pData)
{
CONTRACTL
{
NOTHROW;
GC_NOTRIGGER;
PRECONDITION(CheckPointer(this));
#ifdef DEBUGGING_SUPPORTED
PRECONDITION(m_Crst.OwnedByCurrentThread() ||
CORDebuggerAttached() && g_pDebugInterface->IsStopped());
#else
PRECONDITION(m_Crst.OwnedByCurrentThread());
#endif // DEBUGGING_SUPPORTED
}
CONTRACTL_END;
ListLockEntry *pSearch;
for (pSearch = m_pHead; pSearch != NULL; pSearch = pSearch->m_pNext)
{
if (pSearch->m_pData == pData)
return pSearch;
}
return NULL;
}
#endif // LISTLOCK_I
|