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
WaitHandle.cs
Go to the documentation of this file.
1using System;
7
8namespace System.Threading
9{
10 // Token: 0x02000209 RID: 521
11 [ComVisible(true)]
12 [StructLayout(0)]
13 public abstract class WaitHandle : MarshalByRefObject, IDisposable
14 {
15 // Token: 0x06001274 RID: 4724 RVA: 0x000270C0 File Offset: 0x000252C0
16 protected WaitHandle()
17 {
18 this.Init();
19 }
20
21 // Token: 0x06001275 RID: 4725 RVA: 0x000270DC File Offset: 0x000252DC
22 private void Init()
23 {
24 if (!true)
25 {
26 }
28 }
29
30 // Token: 0x170001C1 RID: 449
31 // (get) Token: 0x06001276 RID: 4726 RVA: 0x000270F4 File Offset: 0x000252F4
32 // (set) Token: 0x06001277 RID: 4727 RVA: 0x00027114 File Offset: 0x00025314
33 [Obsolete("Use the SafeWaitHandle property instead.")]
34 public virtual IntPtr Handle
35 {
36 get
37 {
38 /*
39An exception occurred when decompiling this method (06001276)
40
41ICSharpCode.Decompiler.DecompilerException: Error decompiling System.IntPtr System.Threading.WaitHandle::get_Handle()
42
43 ---> System.Exception: Basic block has to end with unconditional control flow.
44{
45 IL_0011:
46 brtrue(IL_0000, ldloc:int32[exp:bool](var_0_01))
47}
48
49 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
50 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
51 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
52 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
53 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
54 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
55 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
56 --- End of inner exception stack trace ---
57 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
58 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
59*/;
60 }
61 set
62 {
63 if (!true)
64 {
65 }
66 bool flag = value == 1;
67 if (this.safeWaitHandle != null)
68 {
70 return;
71 }
73 }
74 }
75
76 // Token: 0x170001C2 RID: 450
77 // (get) Token: 0x06001278 RID: 4728 RVA: 0x00027148 File Offset: 0x00025348
78 // (set) Token: 0x06001279 RID: 4729 RVA: 0x00027168 File Offset: 0x00025368
80 {
81 [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
82 get
83 {
84 if (this.safeWaitHandle != null)
85 {
87 }
88 if (!true)
89 {
90 return;
91 }
92 }
93 [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
94 set
95 {
96 int num = 1;
98 if (value != null)
99 {
101 return;
102 }
103 if (num == 0)
104 {
105 }
106 }
107 }
108
109 // Token: 0x0600127A RID: 4730 RVA: 0x0002718C File Offset: 0x0002538C
110 internal void SetHandleInternal(SafeWaitHandle handle)
111 {
112 this.safeWaitHandle = handle;
113 IntPtr handle2 = handle.handle;
115 }
116
117 // Token: 0x0600127B RID: 4731 RVA: 0x000271B0 File Offset: 0x000253B0
118 public virtual bool WaitOne(int millisecondsTimeout, bool exitContext)
119 {
120 return this.WaitOne((long)millisecondsTimeout, exitContext);
121 }
122
123 // Token: 0x0600127C RID: 4732 RVA: 0x0000207A File Offset: 0x0000027A
124 public virtual bool WaitOne()
125 {
126 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
127 }
128
129 // Token: 0x0600127D RID: 4733 RVA: 0x0000207A File Offset: 0x0000027A
130 public virtual bool WaitOne(int millisecondsTimeout)
131 {
132 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
133 }
134
135 // Token: 0x0600127E RID: 4734 RVA: 0x000271D0 File Offset: 0x000253D0
136 private bool WaitOne(long timeout, bool exitContext)
137 {
139 bool flag = this.hasThreadAffinity;
140 if (!true)
141 {
142 }
143 bool flag2;
144 return flag2;
145 }
146
147 // Token: 0x0600127F RID: 4735 RVA: 0x000271F0 File Offset: 0x000253F0
148 internal static bool InternalWaitOne(SafeHandle waitableSafeHandle, long millisecondsTimeout, bool hasThreadAffinity, bool exitContext)
149 {
150 /*
151An exception occurred when decompiling this method (0600127F)
152
153ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean System.Threading.WaitHandle::InternalWaitOne(System.Runtime.InteropServices.SafeHandle,System.Int64,System.Boolean,System.Boolean)
154
155 ---> System.Exception: Basic block has to end with unconditional control flow.
156{
157 IL_0003:
158 stloc:string(var_1_0D, call:string(Environment::GetResourceString, ldstr:string("Cannot access a disposed object.")))
159 call:void(WaitHandle::ThrowAbandonedMutexException)
160}
161
162 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
163 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
164 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
165 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
166 --- End of inner exception stack trace ---
167 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
168 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
169*/;
170 }
171
172 // Token: 0x06001280 RID: 4736 RVA: 0x00027210 File Offset: 0x00025410
173 [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
174 public static int WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext)
175 {
176 if (waitHandles != null)
177 {
178 int num;
179 return num;
180 }
181 string resourceString = Environment.GetResourceString("Waithandle array may not be empty.");
182 throw new ArrayTypeMismatchException();
183 }
184
185 // Token: 0x06001281 RID: 4737 RVA: 0x00027274 File Offset: 0x00025474
186 [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
187 public static int WaitAny(WaitHandle[] waitHandles, TimeSpan timeout, bool exitContext)
188 {
189 int num;
190 return num;
191 }
192
193 // Token: 0x06001282 RID: 4738 RVA: 0x00027298 File Offset: 0x00025498
194 [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
195 public static int WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout)
196 {
197 if (!true)
198 {
199 }
200 int num;
201 return num;
202 }
203
204 // Token: 0x06001283 RID: 4739 RVA: 0x0000207A File Offset: 0x0000027A
205 private static void ThrowAbandonedMutexException()
206 {
207 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
208 }
209
210 // Token: 0x06001284 RID: 4740 RVA: 0x0000207A File Offset: 0x0000027A
211 private static void ThrowAbandonedMutexException(int location, WaitHandle handle)
212 {
213 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
214 }
215
216 // Token: 0x06001285 RID: 4741 RVA: 0x000272AC File Offset: 0x000254AC
217 public virtual void Close()
218 {
219 GC.SuppressFinalize(this);
220 }
221
222 // Token: 0x06001286 RID: 4742 RVA: 0x000272C0 File Offset: 0x000254C0
223 protected virtual void Dispose(bool explicitDisposing)
224 {
225 if (this.safeWaitHandle != null)
226 {
227 this.safeWaitHandle.Close();
228 return;
229 }
230 }
231
232 // Token: 0x06001287 RID: 4743 RVA: 0x000272E4 File Offset: 0x000254E4
233 public void Dispose()
234 {
235 GC.SuppressFinalize(this);
236 }
237
238 // Token: 0x06001288 RID: 4744 RVA: 0x000272F8 File Offset: 0x000254F8
239 private static int WaitOneNative(SafeHandle waitableSafeHandle, uint millisecondsTimeout, bool hasThreadAffinity, bool exitContext)
240 {
242 if (synchronizationContext != null)
243 {
245 }
246 if (!false)
247 {
248 }
249 throw new OutOfMemoryException();
250 }
251
252 // Token: 0x06001289 RID: 4745 RVA: 0x00027334 File Offset: 0x00025534
273
274 // Token: 0x0600128A RID: 4746 RVA: 0x0000207A File Offset: 0x0000027A
275 internal unsafe static int Wait_internal(IntPtr* handles, int numHandles, bool waitAll, int ms)
276 {
277 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
278 }
279
280 // Token: 0x0600128B RID: 4747 RVA: 0x000273B0 File Offset: 0x000255B0
281 // Note: this type is marked as 'beforefieldinit'.
282 static WaitHandle()
283 {
284 IntPtr intPtr = (IntPtr)42189704;
285 }
286
287 // Token: 0x040009CE RID: 2510
288 public const int WaitTimeout = 258;
289
290 // Token: 0x040009CF RID: 2511
291 private const int MAX_WAITHANDLES = 64;
292
293 // Token: 0x040009D0 RID: 2512
295
296 // Token: 0x040009D1 RID: 2513
298
299 // Token: 0x040009D2 RID: 2514
300 internal bool hasThreadAffinity;
301
302 // Token: 0x040009D3 RID: 2515
303 private const int WAIT_OBJECT_0 = 0;
304
305 // Token: 0x040009D4 RID: 2516
306 private const int WAIT_ABANDONED = 128;
307
308 // Token: 0x040009D5 RID: 2517
309 private const int WAIT_FAILED = 2147483647;
310
311 // Token: 0x040009D6 RID: 2518
312 private const int ERROR_TOO_MANY_POSTS = 298;
313
314 // Token: 0x040009D7 RID: 2519
315 private const int ERROR_NOT_OWNED_BY_CALLER = 299;
316
317 // Token: 0x040009D8 RID: 2520
318 protected static readonly IntPtr InvalidHandle;
319
320 // Token: 0x040009D9 RID: 2521
321 internal const int MaxWaitHandles = 64;
322 }
323}
class f__AnonymousType0<< Count > j__TPar
static string GetResourceString(string key)
static void SuppressFinalize(object obj)
Definition GC.cs:116
static void ThrowAbandonedMutexException()
static int WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout)
static int WaitAny(WaitHandle[] waitHandles, TimeSpan timeout, bool exitContext)
SafeWaitHandle safeWaitHandle
static bool InternalWaitOne(SafeHandle waitableSafeHandle, long millisecondsTimeout, bool hasThreadAffinity, bool exitContext)
virtual void Dispose(bool explicitDisposing)
virtual bool WaitOne(int millisecondsTimeout, bool exitContext)
static int WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext)
static unsafe int Wait_internal(IntPtr *handles, int numHandles, bool waitAll, int ms)
virtual bool WaitOne(int millisecondsTimeout)
static int WaitOneNative(SafeHandle waitableSafeHandle, uint millisecondsTimeout, bool hasThreadAffinity, bool exitContext)
static void ThrowAbandonedMutexException(int location, WaitHandle handle)
static int WaitMultiple(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext, bool WaitAll)
void SetHandleInternal(SafeWaitHandle handle)
static readonly IntPtr InvalidHandle
bool WaitOne(long timeout, bool exitContext)