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
ThreadPoolWorkQueue.cs
Go to the documentation of this file.
1using System;
5
6namespace System.Threading
7{
8 // Token: 0x02000200 RID: 512
9 internal sealed class ThreadPoolWorkQueue
10 {
11 // Token: 0x06001239 RID: 4665 RVA: 0x00026818 File Offset: 0x00024A18
13 {
14 }
15
16 // Token: 0x0600123A RID: 4666 RVA: 0x0000207A File Offset: 0x0000027A
18 {
19 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
20 }
21
22 // Token: 0x0600123B RID: 4667 RVA: 0x0002682C File Offset: 0x00024A2C
23 internal void EnsureThreadRequested()
24 {
25 int num = 1;
27 if (num == 0)
28 {
29 }
30 }
31
32 // Token: 0x0600123C RID: 4668 RVA: 0x00026848 File Offset: 0x00024A48
34 {
35 int num = this.numOutstandingThreadRequests;
36 }
37
38 // Token: 0x0600123D RID: 4669 RVA: 0x0002685C File Offset: 0x00024A5C
39 public void Enqueue(IThreadPoolWorkItem callback, bool forceGlobal)
40 {
41 }
42
43 // Token: 0x0600123E RID: 4670 RVA: 0x00026888 File Offset: 0x00024A88
44 internal bool LocalFindAndPop(IThreadPoolWorkItem callback)
45 {
46 bool flag;
47 return flag;
48 }
49
50 // Token: 0x0600123F RID: 4671 RVA: 0x0000207A File Offset: 0x0000027A
52 {
53 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
54 }
55
56 // Token: 0x06001240 RID: 4672 RVA: 0x00026898 File Offset: 0x00024A98
57 internal static bool Dispatch()
58 {
59 int num = 1;
60 if (num == 0)
61 {
62 }
65 if (num == 0)
66 {
67 }
68 long num3;
69 if (num != 0)
70 {
71 int value = 1.m_value;
72 long num2 = 0L;
73 num3 = 0L;
74 int num4 = 9;
75 if (num2 != 0L)
76 {
77 throw new OutOfMemoryException();
78 }
79 if (num4 != 0)
80 {
81 return false;
82 }
83 }
84 long value2 = num3.m_value;
85 int num5 = 1;
86 while (num5 != 0)
87 {
88 }
89 if (value2 != 0L)
90 {
91 }
92 return false;
93 }
94
95 // Token: 0x06001241 RID: 4673 RVA: 0x0002693C File Offset: 0x00024B3C
96 // Note: this type is marked as 'beforefieldinit'.
98 {
99 }
100
101 // Token: 0x040009B8 RID: 2488
103
104 // Token: 0x040009B9 RID: 2489
106
107 // Token: 0x040009BA RID: 2490
109
110 // Token: 0x040009BB RID: 2491
112
113 // Token: 0x02000201 RID: 513
114 internal class SparseArray<T> where T : class
115 {
116 // Token: 0x06001242 RID: 4674 RVA: 0x0002694C File Offset: 0x00024B4C
118 {
119 this.m_array = this;
120 }
121
122 // Token: 0x170001BF RID: 447
123 // (get) Token: 0x06001243 RID: 4675 RVA: 0x0000207A File Offset: 0x0000027A
124 internal T[] Current
125 {
126 get
127 {
128 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
129 }
130 }
131
132 // Token: 0x06001244 RID: 4676 RVA: 0x0000207A File Offset: 0x0000027A
133 internal int Add(T e)
134 {
135 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
136 }
137
138 // Token: 0x06001245 RID: 4677 RVA: 0x0000207A File Offset: 0x0000027A
139 internal void Remove(T e)
140 {
141 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
142 }
143
144 // Token: 0x040009BC RID: 2492
145 private T[] m_array;
146 }
147
148 // Token: 0x02000202 RID: 514
149 internal class WorkStealingQueue
150 {
151 // Token: 0x06001246 RID: 4678 RVA: 0x00026968 File Offset: 0x00024B68
153 {
154 int num = 1;
155 int tailIndex = this.m_tailIndex;
156 int tailIndex2 = this.m_tailIndex;
157 int headIndex = this.m_headIndex;
158 int mask = this.m_mask;
159 int tailIndex3 = this.m_tailIndex;
160 this.m_headIndex = num;
161 int mask2 = this.m_mask;
162 this.m_tailIndex = mask;
163 }
164
165 // Token: 0x06001247 RID: 4679 RVA: 0x00026AC4 File Offset: 0x00024CC4
167 {
169 int tailIndex = this.m_tailIndex;
170 int mask = this.m_mask;
171 int tailIndex2 = this.m_tailIndex;
172 int headIndex = this.m_headIndex;
174 int mask2 = this.m_mask;
176 int mask3 = this.m_mask;
178 int mask4 = this.m_mask;
179 int tailIndex3 = this.m_tailIndex;
180 int tailIndex4 = this.m_tailIndex;
181 int headIndex2 = this.m_headIndex;
182 int headIndex3 = this.m_headIndex;
183 long num = 0L;
184 int num2 = 8;
185 if (num != 0L)
186 {
187 throw new OutOfMemoryException();
188 }
189 if (num2 == 0)
190 {
191 int headIndex4 = this.m_headIndex;
192 throw new OutOfMemoryException();
193 }
194 bool flag;
195 return flag;
196 }
197
198 // Token: 0x06001248 RID: 4680 RVA: 0x00026B7C File Offset: 0x00024D7C
200 {
201 int tailIndex = this.m_tailIndex;
202 int headIndex = this.m_headIndex;
203 int headIndex2 = this.m_headIndex;
204 int mask = this.m_mask;
206 while (mask == 0)
207 {
208 }
209 int headIndex3 = this.m_headIndex;
210 int mask2 = this.m_mask;
212 if (headIndex != 0)
213 {
215 if (false)
216 {
217 throw new OutOfMemoryException();
218 }
219 }
220 throw new OutOfMemoryException();
221 }
222
223 // Token: 0x06001249 RID: 4681 RVA: 0x00026C0C File Offset: 0x00024E0C
225 {
226 long num = 0L;
227 return this.TrySteal(obj, missedSteal, (int)num);
228 }
229
230 // Token: 0x0600124A RID: 4682 RVA: 0x00026C24 File Offset: 0x00024E24
231 private bool TrySteal([Out] IThreadPoolWorkItem obj, bool missedSteal, int millisecondsTimeout)
232 {
233 int num = 1;
234 int headIndex = this.m_headIndex;
235 int tailIndex = this.m_tailIndex;
236 int tailIndex2 = this.m_tailIndex;
237 int mask = this.m_mask;
239 long num2;
240 if (mask != 0)
241 {
243 num2 = 0L;
244 missedSteal.m_value = num != 0;
245 }
246 if (num2 == 0L)
247 {
248 throw new OutOfMemoryException();
249 }
250 throw new OutOfMemoryException();
251 }
252
253 // Token: 0x0600124B RID: 4683 RVA: 0x00026CA8 File Offset: 0x00024EA8
255 {
256 }
257
258 // Token: 0x040009BD RID: 2493
260
261 // Token: 0x040009BE RID: 2494
262 private int m_mask = 31;
263
264 // Token: 0x040009BF RID: 2495
265 private int m_headIndex;
266
267 // Token: 0x040009C0 RID: 2496
268 private int m_tailIndex;
269
270 // Token: 0x040009C1 RID: 2497
272 }
273
274 // Token: 0x02000203 RID: 515
275 internal class QueueSegment
276 {
277 // Token: 0x0600124C RID: 4684 RVA: 0x00026CD0 File Offset: 0x00024ED0
278 private void GetIndexes([Out] int upper, [Out] int lower)
279 {
280 int num = this.indexes;
281 }
282
283 // Token: 0x0600124D RID: 4685 RVA: 0x0000207A File Offset: 0x0000027A
285 {
286 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
287 }
288
289 // Token: 0x0600124E RID: 4686 RVA: 0x00026CE4 File Offset: 0x00024EE4
290 [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
292 {
293 }
294
295 // Token: 0x0600124F RID: 4687 RVA: 0x00026CF8 File Offset: 0x00024EF8
296 public bool IsUsedUp()
297 {
298 /*
299An exception occurred when decompiling this method (0600124F)
300
301ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean System.Threading.ThreadPoolWorkQueue/QueueSegment::IsUsedUp()
302
303 ---> System.Exception: Basic block has to end with unconditional control flow.
304{
305 Block_0:
306 stloc:int32(var_0_06, ldfld:int32(QueueSegment::indexes, ldloc:QueueSegment(this)))
307 stloc:class System.Threading.IThreadPoolWorkItem[](var_1_0D, ldfld:class System.Threading.IThreadPoolWorkItem[](QueueSegment::nodes, ldloc:QueueSegment(this)))
308}
309
310 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
311 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
312 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
313 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
314 --- End of inner exception stack trace ---
315 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
316 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
317*/;
318 }
319
320 // Token: 0x06001250 RID: 4688 RVA: 0x00026D14 File Offset: 0x00024F14
322 {
323 /*
324An exception occurred when decompiling this method (06001250)
325
326ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean System.Threading.ThreadPoolWorkQueue/QueueSegment::TryEnqueue(System.Threading.IThreadPoolWorkItem)
327
328 ---> System.Exception: Basic block has to end with unconditional control flow.
329{
330 Block_0:
331 stloc:int32(var_0_06, ldfld:int32(QueueSegment::indexes, ldloc:QueueSegment(this)))
332 stloc:class System.Threading.IThreadPoolWorkItem[](var_1_0D, ldfld:class System.Threading.IThreadPoolWorkItem[](QueueSegment::nodes, ldloc:QueueSegment(this)))
333 stloc:class System.Threading.IThreadPoolWorkItem[](var_2_14, ldfld:class System.Threading.IThreadPoolWorkItem[](QueueSegment::nodes, ldloc:QueueSegment(this)))
334 stfld:QueueSegment(QueueSegment::Next, ldloc:QueueSegment(this), ldloc:IThreadPoolWorkItem[exp:QueueSegment](node))
335}
336
337 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
338 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
339 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
340 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
341 --- End of inner exception stack trace ---
342 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
343 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
344*/;
345 }
346
347 // Token: 0x06001251 RID: 4689 RVA: 0x00026D44 File Offset: 0x00024F44
348 public bool TryDequeue([Out] IThreadPoolWorkItem node)
349 {
350 /*
351An exception occurred when decompiling this method (06001251)
352
353ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean System.Threading.ThreadPoolWorkQueue/QueueSegment::TryDequeue(System.Threading.IThreadPoolWorkItem)
354
355 ---> System.Exception: Basic block has to end with unconditional control flow.
356{
357 IL_001A:
358 stloc:class System.Threading.IThreadPoolWorkItem[](var_4_20, ldfld:class System.Threading.IThreadPoolWorkItem[](QueueSegment::nodes, ldloc:QueueSegment(this)))
359}
360
361 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
362 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
363 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
364 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
365 --- End of inner exception stack trace ---
366 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
367 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
368*/;
369 }
370
371 // Token: 0x040009C2 RID: 2498
373
374 // Token: 0x040009C3 RID: 2499
375 private int indexes;
376
377 // Token: 0x040009C4 RID: 2500
379 }
380 }
381}
class f__AnonymousType0<< Count > j__TPar
static int TickCount
bool CompareExchangeIndexes(int prevUpper, int newUpper, int prevLower, int newLower)
bool TryDequeue([Out] IThreadPoolWorkItem node)
void GetIndexes([Out] int upper, [Out] int lower)
bool TrySteal([Out] IThreadPoolWorkItem obj, bool missedSteal)
bool TrySteal([Out] IThreadPoolWorkItem obj, bool missedSteal, int millisecondsTimeout)
void Enqueue(IThreadPoolWorkItem callback, bool forceGlobal)
bool LocalFindAndPop(IThreadPoolWorkItem callback)
ThreadPoolWorkQueueThreadLocals EnsureCurrentThreadHasQueue()
ThreadPoolWorkQueue.QueueSegment queueHead
void Dequeue(ThreadPoolWorkQueueThreadLocals tl, [Out] IThreadPoolWorkItem callback, [Out] bool missedSteal)
static ThreadPoolWorkQueue.SparseArray< ThreadPoolWorkQueue.WorkStealingQueue > allThreadQueues
ThreadPoolWorkQueue.QueueSegment queueTail