terraria-cpp2il-methodrecon
v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
RegisteredWaitHandle.cs
Go to the documentation of this file.
1
using
System
;
2
using
System.Runtime.InteropServices
;
3
using
Microsoft.Win32.SafeHandles
;
4
5
namespace
System.Threading
6
{
7
// Token: 0x0200020D RID: 525
8
[
ComVisible
(
true
)]
9
public
sealed
class
RegisteredWaitHandle
:
MarshalByRefObject
10
{
11
// Token: 0x060012A9 RID: 4777 RVA: 0x00027474 File Offset: 0x00025674
12
internal
RegisteredWaitHandle
(
WaitHandle
waitObject
,
WaitOrTimerCallback
callback,
object
state
,
TimeSpan
timeout,
bool
executeOnlyOnce
)
13
{
14
this._waitObject
=
waitObject
;
15
this._callback
= callback;
16
this._timeout
= timeout;
17
this._state
=
state
;
18
}
19
20
// Token: 0x060012AA RID: 4778 RVA: 0x000274A8 File Offset: 0x000256A8
21
internal
void
Wait
(
object
state
)
22
{
23
SafeWaitHandle
safeWaitHandle = this.
_waitObject
.
SafeWaitHandle
;
24
WaitHandle
waitObject
= this.
_waitObject
;
25
if
(waitObject !=
null
&&
waitObject
==
null
)
26
{
27
throw
new
ArrayTypeMismatchException
();
28
}
29
ManualResetEvent
cancelEvent
= this.
_cancelEvent
;
30
if
(cancelEvent !=
null
&&
cancelEvent
==
null
)
31
{
32
throw
new
ArrayTypeMismatchException
();
33
}
34
TimeSpan
timeout = this.
_timeout
;
35
if
(!this.
_unregistered
)
36
{
37
int
callsInProcess
= this.
_callsInProcess
;
38
long
num = 0
L
;
39
this._callsInProcess
=
callsInProcess
;
40
if
(
callsInProcess
!= 0)
41
{
42
Monitor
.
Exit
(
this
);
43
}
44
if
(num != 0
L
)
45
{
46
throw
new
OutOfMemoryException
();
47
}
48
if
(!this.
_unregistered
)
49
{
50
bool
executeOnlyOnce
= this.
_executeOnlyOnce
;
51
while
(!executeOnlyOnce)
52
{
53
}
54
return
;
55
}
56
}
57
int
callsInProcess2
= this.
_callsInProcess
;
58
int
num2
= 1;
59
this._unregistered
= num2 != 0;
60
if
(
callsInProcess2
!= 0)
61
{
62
return
;
63
}
64
WaitHandle
finalEvent
= this.
_finalEvent
;
65
while
(finalEvent ==
null
)
66
{
67
}
68
bool
flag =
NativeEventCalls
.
SetEvent
(
finalEvent
.SafeWaitHandle);
69
long
num3
= 0
L
;
70
if
(
callsInProcess2
!= 0)
71
{
72
Monitor
.
Exit
(
this
);
73
}
74
if
(
num3
!= 0
L
)
75
{
76
throw
new
OutOfMemoryException
();
77
}
78
long
num4
= 0
L
;
79
if
(
callsInProcess2
!= 0)
80
{
81
this.
_waitObject
.
SafeWaitHandle
.
DangerousRelease
();
82
}
83
if
(num4 == 0
L
)
84
{
85
return
;
86
}
87
throw
new
OutOfMemoryException
();
88
}
89
90
// Token: 0x060012AB RID: 4779 RVA: 0x00027620 File Offset: 0x00025820
91
private
void
DoCallBack
(
object
timedOut
)
92
{
93
WaitOrTimerCallback
callback = this.
_callback
;
94
if
(callback !=
null
)
95
{
96
object
state
= this.
_state
;
97
IntPtr
method_code = callback.
method_code
;
98
IntPtr
invoke_impl = callback.
invoke_impl
;
99
IntPtr
method = callback.
method
;
100
}
101
}
102
103
// Token: 0x060012AC RID: 4780 RVA: 0x00027660 File Offset: 0x00025860
104
[
ComVisible
(
true
)]
105
public
bool
Unregister
(
WaitHandle
waitObject
)
106
{
107
bool
unregistered = this.
_unregistered
;
108
long
num;
109
if
(unregistered)
110
{
111
num = 0
L
;
112
}
113
ManualResetEvent
cancelEvent
= this.
_cancelEvent
;
114
this._finalEvent
= num;
115
this._unregistered
=
true
;
116
bool
flag =
cancelEvent
.Set();
117
long
num2
= 0
L
;
118
if
(unregistered)
119
{
120
Monitor
.
Exit
(
this
);
121
}
122
if
(
num2
== 0
L
)
123
{
124
return
true
;
125
}
126
throw
new
OutOfMemoryException
();
127
}
128
129
// Token: 0x040009DA RID: 2522
130
private
WaitHandle
_waitObject
;
131
132
// Token: 0x040009DB RID: 2523
133
private
WaitOrTimerCallback
_callback
;
134
135
// Token: 0x040009DC RID: 2524
136
private
object
_state
;
137
138
// Token: 0x040009DD RID: 2525
139
private
WaitHandle
_finalEvent
;
140
141
// Token: 0x040009DE RID: 2526
142
private
ManualResetEvent
_cancelEvent
;
143
144
// Token: 0x040009DF RID: 2527
145
private
TimeSpan
_timeout
;
146
147
// Token: 0x040009E0 RID: 2528
148
private
int
_callsInProcess
;
149
150
// Token: 0x040009E1 RID: 2529
151
private
bool
_executeOnlyOnce
;
152
153
// Token: 0x040009E2 RID: 2530
154
private
bool
_unregistered
;
155
}
156
}
j__TPar
class f__AnonymousType0<< Count > j__TPar
Definition
--f__AnonymousType0.cs:8
Microsoft.Win32.SafeHandles.SafeWaitHandle
Definition
SafeWaitHandle.cs:9
System.ArrayTypeMismatchException
Definition
ArrayTypeMismatchException.cs:9
System.Delegate.method_code
IntPtr method_code
Definition
Delegate.cs:386
System.Delegate.method
IntPtr method
Definition
Delegate.cs:377
System.Delegate.invoke_impl
IntPtr invoke_impl
Definition
Delegate.cs:371
System.MarshalByRefObject
Definition
MarshalByRefObject.cs:13
System.OutOfMemoryException
Definition
OutOfMemoryException.cs:9
System.Runtime.InteropServices.SafeHandle.DangerousRelease
void DangerousRelease()
Definition
SafeHandle.cs:123
System.Threading.ManualResetEvent
Definition
ManualResetEvent.cs:7
System.Threading.Monitor.Exit
static void Exit(object obj)
Definition
Monitor.cs:47
System.Threading.Monitor
Definition
Monitor.cs:9
System.Threading.NativeEventCalls.SetEvent
static bool SetEvent(SafeWaitHandle handle)
Definition
NativeEventCalls.cs:42
System.Threading.NativeEventCalls
Definition
NativeEventCalls.cs:10
System.Threading.RegisteredWaitHandle._finalEvent
WaitHandle _finalEvent
Definition
RegisteredWaitHandle.cs:139
System.Threading.RegisteredWaitHandle._state
object _state
Definition
RegisteredWaitHandle.cs:136
System.Threading.RegisteredWaitHandle.Wait
void Wait(object state)
Definition
RegisteredWaitHandle.cs:21
System.Threading.RegisteredWaitHandle._executeOnlyOnce
bool _executeOnlyOnce
Definition
RegisteredWaitHandle.cs:151
System.Threading.RegisteredWaitHandle.Unregister
bool Unregister(WaitHandle waitObject)
Definition
RegisteredWaitHandle.cs:105
System.Threading.RegisteredWaitHandle._waitObject
WaitHandle _waitObject
Definition
RegisteredWaitHandle.cs:130
System.Threading.RegisteredWaitHandle.RegisteredWaitHandle
RegisteredWaitHandle(WaitHandle waitObject, WaitOrTimerCallback callback, object state, TimeSpan timeout, bool executeOnlyOnce)
Definition
RegisteredWaitHandle.cs:12
System.Threading.RegisteredWaitHandle._callsInProcess
int _callsInProcess
Definition
RegisteredWaitHandle.cs:148
System.Threading.RegisteredWaitHandle._unregistered
bool _unregistered
Definition
RegisteredWaitHandle.cs:154
System.Threading.RegisteredWaitHandle._cancelEvent
ManualResetEvent _cancelEvent
Definition
RegisteredWaitHandle.cs:142
System.Threading.RegisteredWaitHandle._timeout
TimeSpan _timeout
Definition
RegisteredWaitHandle.cs:145
System.Threading.RegisteredWaitHandle.DoCallBack
void DoCallBack(object timedOut)
Definition
RegisteredWaitHandle.cs:91
System.Threading.RegisteredWaitHandle._callback
WaitOrTimerCallback _callback
Definition
RegisteredWaitHandle.cs:133
System.Threading.RegisteredWaitHandle
Definition
RegisteredWaitHandle.cs:10
System.Threading.WaitHandle.SafeWaitHandle
SafeWaitHandle SafeWaitHandle
Definition
WaitHandle.cs:80
System.Threading.WaitHandle
Definition
WaitHandle.cs:14
System.Threading.WaitOrTimerCallback
Definition
WaitOrTimerCallback.cs:9
Microsoft.Win32.SafeHandles
Definition
CriticalHandleMinusOneIsInvalid.cs:6
System.Runtime.InteropServices
Definition
_Activator.cs:4
System.Threading
Definition
_ThreadPoolWaitCallback.cs:4
System.ExceptionArgument.state
@ state
System.ConsoleKey.L
@ L
System
Definition
__ComObject.cs:4
System.IntPtr
Definition
IntPtr.cs:13
System.TimeSpan
Definition
TimeSpan.cs:10
source
mscorlib
System
Threading
RegisteredWaitHandle.cs
Generated by
1.10.0