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/*============================================================
6**
7** Header: DelegateInfo.h
8**
9**
10** Purpose: Native methods on System.ThreadPool
11** and its inner classes
12**
13
14**
15===========================================================*/
16#ifndef DELEGATE_INFO
17#define DELEGATE_INFO
18
19struct DelegateInfo;
20typedef DelegateInfo* DelegateInfoPtr;
21
22struct DelegateInfo
23{
24 ADID m_appDomainId;
25 OBJECTHANDLE m_stateHandle;
26 OBJECTHANDLE m_eventHandle;
27 OBJECTHANDLE m_registeredWaitHandle;
28
29#ifndef DACCESS_COMPILE
30 void Release()
31 {
32 CONTRACTL {
33 // m_compressedStack->Release() can actually throw today because it has got a call
34 // to new down the stack. However that is recent and the semantic of that api is such
35 // it should not throw. I am expecting clenup of that function to take care of that
36 // so I am adding this comment to make sure the issue is document.
37 // Remove this comment once that work is done
38 NOTHROW;
39 GC_TRIGGERS;
40 MODE_COOPERATIVE;
41 FORBID_FAULT;
42 }
43 CONTRACTL_END;
44
45
46 if (m_stateHandle)
47 DestroyHandle(m_stateHandle);
48 if (m_eventHandle)
49 DestroyHandle(m_eventHandle);
50 if (m_registeredWaitHandle)
51 DestroyHandle(m_registeredWaitHandle);
52 }
53#endif
54
55 static DelegateInfo *MakeDelegateInfo(AppDomain *pAppDomain,
56 OBJECTREF *state,
57 OBJECTREF *waitEvent,
58 OBJECTREF *registeredWaitObject);
59};
60
61
62
63
64
65#endif // DELEGATE_INFO
66