This commit is contained in:
niko
2026-04-11 22:19:20 +02:00
parent 45b857ff11
commit 8fc35183db
17034 changed files with 2863552 additions and 0 deletions
+287
View File
@@ -0,0 +1,287 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Cpp2IlInjected;
namespace System.Threading
{
/// <summary>Represents a lightweight alternative to <see cref="T:System.Threading.Semaphore" /> that limits the number of threads that can access a resource or pool of resources concurrently.</summary>
// Token: 0x0200030C RID: 780
[Token(Token = "0x200030C")]
[DebuggerDisplay("Current Count = {m_currentCount}")]
[ComVisible(false)]
public class SemaphoreSlim : IDisposable
{
/// <summary>Initializes a new instance of the <see cref="T:System.Threading.SemaphoreSlim" /> class, specifying the initial and maximum number of requests that can be granted concurrently.</summary>
/// <param name="initialCount">The initial number of requests for the semaphore that can be granted concurrently.</param>
/// <param name="maxCount">The maximum number of requests for the semaphore that can be granted concurrently.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="initialCount" /> is less than 0, or <paramref name="initialCount" /> is greater than <paramref name="maxCount" />, or <paramref name="maxCount" /> is equal to or less than 0.</exception>
// Token: 0x06001CDC RID: 7388 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6001CDC")]
[Address(RVA = "0x2926E70", Offset = "0x2925C70", VA = "0x182926E70")]
public SemaphoreSlim(int initialCount, int maxCount)
{
}
/// <summary>Blocks the current thread until it can enter the <see cref="T:System.Threading.SemaphoreSlim" />.</summary>
/// <exception cref="T:System.ObjectDisposedException">The current instance has already been disposed.</exception>
// Token: 0x06001CDD RID: 7389 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6001CDD")]
[Address(RVA = "0x2926DB0", Offset = "0x2925BB0", VA = "0x182926DB0")]
public void Wait()
{
}
/// <summary>Blocks the current thread until it can enter the <see cref="T:System.Threading.SemaphoreSlim" />, using a 32-bit signed integer that specifies the timeout.</summary>
/// <param name="millisecondsTimeout">The number of milliseconds to wait, <see cref="F:System.Threading.Timeout.Infinite" />(-1) to wait indefinitely, or zero to test the state of the wait handle and return immediately.</param>
/// <returns>
/// <see langword="true" /> if the current thread successfully entered the <see cref="T:System.Threading.SemaphoreSlim" />; otherwise, <see langword="false" />.</returns>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="millisecondsTimeout" /> is a negative number other than -1, which represents an infinite timeout -or- timeout is greater than <see cref="F:System.Int32.MaxValue" />.</exception>
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Threading.SemaphoreSlim" /> has been disposed.</exception>
// Token: 0x06001CDE RID: 7390 RVA: 0x00012BB8 File Offset: 0x00010DB8
[Token(Token = "0x6001CDE")]
[Address(RVA = "0x2926890", Offset = "0x2925690", VA = "0x182926890")]
public bool Wait(int millisecondsTimeout)
{
return default(bool);
}
/// <summary>Blocks the current thread until it can enter the <see cref="T:System.Threading.SemaphoreSlim" />, using a 32-bit signed integer that specifies the timeout, while observing a <see cref="T:System.Threading.CancellationToken" />.</summary>
/// <param name="millisecondsTimeout">The number of milliseconds to wait, <see cref="F:System.Threading.Timeout.Infinite" />(-1) to wait indefinitely, or zero to test the state of the wait handle and return immediately.</param>
/// <param name="cancellationToken">The <see cref="T:System.Threading.CancellationToken" /> to observe.</param>
/// <returns>
/// <see langword="true" /> if the current thread successfully entered the <see cref="T:System.Threading.SemaphoreSlim" />; otherwise, <see langword="false" />.</returns>
/// <exception cref="T:System.OperationCanceledException">
/// <paramref name="cancellationToken" /> was canceled.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="millisecondsTimeout" /> is a negative number other than -1, which represents an infinite timeout -or- timeout is greater than <see cref="F:System.Int32.MaxValue" />.</exception>
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Threading.SemaphoreSlim" /> instance has been disposed, or the <see cref="T:System.Threading.CancellationTokenSource" /> that created <paramref name="cancellationToken" /> has been disposed.</exception>
// Token: 0x06001CDF RID: 7391 RVA: 0x00012BD0 File Offset: 0x00010DD0
[Token(Token = "0x6001CDF")]
[Address(RVA = "0x29268A0", Offset = "0x29256A0", VA = "0x1829268A0")]
public bool Wait(int millisecondsTimeout, CancellationToken cancellationToken)
{
return default(bool);
}
// Token: 0x06001CE0 RID: 7392 RVA: 0x00012BE8 File Offset: 0x00010DE8
[Token(Token = "0x6001CE0")]
[Address(RVA = "0x29267E0", Offset = "0x29255E0", VA = "0x1829267E0")]
private bool WaitUntilCountOrTimeout(int millisecondsTimeout, uint startTime, CancellationToken cancellationToken)
{
return default(bool);
}
/// <summary>Asynchronously waits to enter the <see cref="T:System.Threading.SemaphoreSlim" />.</summary>
/// <returns>A task that will complete when the semaphore has been entered.</returns>
/// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Threading.SemaphoreSlim" /> has been disposed.</exception>
// Token: 0x06001CE1 RID: 7393 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6001CE1")]
[Address(RVA = "0x29266C0", Offset = "0x29254C0", VA = "0x1829266C0")]
public Task WaitAsync()
{
return null;
}
/// <summary>Asynchronously waits to enter the <see cref="T:System.Threading.SemaphoreSlim" />, using a 32-bit signed integer to measure the time interval, while observing a <see cref="T:System.Threading.CancellationToken" />.</summary>
/// <param name="millisecondsTimeout">The number of milliseconds to wait, <see cref="F:System.Threading.Timeout.Infinite" /> (-1) to wait indefinitely, or zero to test the state of the wait handle and return immediately.</param>
/// <param name="cancellationToken">The <see cref="T:System.Threading.CancellationToken" /> to observe.</param>
/// <returns>A task that will complete with a result of <see langword="true" /> if the current thread successfully entered the <see cref="T:System.Threading.SemaphoreSlim" />, otherwise with a result of <see langword="false" />.</returns>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="millisecondsTimeout" /> is a number other than -1, which represents an infinite timeout -or- timeout is greater than <see cref="F:System.Int32.MaxValue" />.</exception>
/// <exception cref="T:System.ObjectDisposedException">The current instance has already been disposed.</exception>
/// <exception cref="T:System.OperationCanceledException">
/// <paramref name="cancellationToken" /> was canceled.</exception>
// Token: 0x06001CE2 RID: 7394 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6001CE2")]
[Address(RVA = "0x2926240", Offset = "0x2925040", VA = "0x182926240")]
public Task<bool> WaitAsync(int millisecondsTimeout, CancellationToken cancellationToken)
{
return null;
}
// Token: 0x06001CE3 RID: 7395 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6001CE3")]
[Address(RVA = "0x2925C40", Offset = "0x2924A40", VA = "0x182925C40")]
private SemaphoreSlim.TaskNode CreateAndAddAsyncWaiter()
{
return null;
}
// Token: 0x06001CE4 RID: 7396 RVA: 0x00012C00 File Offset: 0x00010E00
[Token(Token = "0x6001CE4")]
[Address(RVA = "0x29261C0", Offset = "0x2924FC0", VA = "0x1829261C0")]
private bool RemoveAsyncWaiter(SemaphoreSlim.TaskNode task)
{
return default(bool);
}
// Token: 0x06001CE5 RID: 7397 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6001CE5")]
[Address(RVA = "0x29266D0", Offset = "0x29254D0", VA = "0x1829266D0")]
private Task<bool> WaitUntilCountOrTimeoutAsync(SemaphoreSlim.TaskNode asyncWaiter, int millisecondsTimeout, CancellationToken cancellationToken)
{
return null;
}
/// <summary>Releases the <see cref="T:System.Threading.SemaphoreSlim" /> object once.</summary>
/// <returns>The previous count of the <see cref="T:System.Threading.SemaphoreSlim" />.</returns>
/// <exception cref="T:System.ObjectDisposedException">The current instance has already been disposed.</exception>
/// <exception cref="T:System.Threading.SemaphoreFullException">The <see cref="T:System.Threading.SemaphoreSlim" /> has already reached its maximum size.</exception>
// Token: 0x06001CE6 RID: 7398 RVA: 0x00012C18 File Offset: 0x00010E18
[Token(Token = "0x6001CE6")]
[Address(RVA = "0x2925E20", Offset = "0x2924C20", VA = "0x182925E20")]
public int Release()
{
return 0;
}
/// <summary>Releases the <see cref="T:System.Threading.SemaphoreSlim" /> object a specified number of times.</summary>
/// <param name="releaseCount">The number of times to exit the semaphore.</param>
/// <returns>The previous count of the <see cref="T:System.Threading.SemaphoreSlim" />.</returns>
/// <exception cref="T:System.ObjectDisposedException">The current instance has already been disposed.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="releaseCount" /> is less than 1.</exception>
/// <exception cref="T:System.Threading.SemaphoreFullException">The <see cref="T:System.Threading.SemaphoreSlim" /> has already reached its maximum size.</exception>
// Token: 0x06001CE7 RID: 7399 RVA: 0x00012C30 File Offset: 0x00010E30
[Token(Token = "0x6001CE7")]
[Address(RVA = "0x2925E30", Offset = "0x2924C30", VA = "0x182925E30")]
public int Release(int releaseCount)
{
return 0;
}
// Token: 0x06001CE8 RID: 7400 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6001CE8")]
[Address(RVA = "0x2925E10", Offset = "0x2924C10", VA = "0x182925E10")]
private static void QueueWaiterTask(SemaphoreSlim.TaskNode waiterTask)
{
}
/// <summary>Releases all resources used by the current instance of the <see cref="T:System.Threading.SemaphoreSlim" /> class.</summary>
// Token: 0x06001CE9 RID: 7401 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6001CE9")]
[Address(RVA = "0x2925D90", Offset = "0x2924B90", VA = "0x182925D90", Slot = "4")]
public void Dispose()
{
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Threading.SemaphoreSlim" />, and optionally releases the managed resources.</summary>
/// <param name="disposing">
/// <see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param>
// Token: 0x06001CEA RID: 7402 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6001CEA")]
[Address(RVA = "0x2925D10", Offset = "0x2924B10", VA = "0x182925D10", Slot = "5")]
protected virtual void Dispose(bool disposing)
{
}
// Token: 0x06001CEB RID: 7403 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6001CEB")]
[Address(RVA = "0x2925A40", Offset = "0x2924840", VA = "0x182925A40")]
private static void CancellationTokenCanceledEventHandler(object obj)
{
}
// Token: 0x06001CEC RID: 7404 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6001CEC")]
[Address(RVA = "0x2925BA0", Offset = "0x29249A0", VA = "0x182925BA0")]
private void CheckDispose()
{
}
// Token: 0x06001CED RID: 7405 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6001CED")]
[Address(RVA = "0x2925E00", Offset = "0x2924C00", VA = "0x182925E00")]
private static string GetResourceString(string str)
{
return null;
}
// Token: 0x04001089 RID: 4233
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4001089")]
private int m_currentCount;
// Token: 0x0400108A RID: 4234
[global::Cpp2IlInjected.FieldOffset(Offset = "0x14")]
[Token(Token = "0x400108A")]
private readonly int m_maxCount;
// Token: 0x0400108B RID: 4235
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x400108B")]
private int m_waitCount;
// Token: 0x0400108C RID: 4236
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x400108C")]
private object m_lockObj;
// Token: 0x0400108D RID: 4237
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x400108D")]
private ManualResetEvent m_waitHandle;
// Token: 0x0400108E RID: 4238
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x400108E")]
private SemaphoreSlim.TaskNode m_asyncHead;
// Token: 0x0400108F RID: 4239
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x400108F")]
private SemaphoreSlim.TaskNode m_asyncTail;
// Token: 0x04001090 RID: 4240
[Token(Token = "0x4001090")]
private static readonly Task<bool> s_trueTask;
// Token: 0x04001091 RID: 4241
[Token(Token = "0x4001091")]
private const int NO_MAXIMUM = 2147483647;
// Token: 0x04001092 RID: 4242
[Token(Token = "0x4001092")]
private static Action<object> s_cancellationTokenCanceledEventHandler;
// Token: 0x0200030D RID: 781
[Token(Token = "0x200030D")]
private sealed class TaskNode : Task<bool>, IThreadPoolWorkItem
{
// Token: 0x06001CEF RID: 7407 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6001CEF")]
[Address(RVA = "0x2927FC0", Offset = "0x2926DC0", VA = "0x182927FC0")]
internal TaskNode()
{
}
// Token: 0x06001CF0 RID: 7408 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6001CF0")]
[Address(RVA = "0x2927F80", Offset = "0x2926D80", VA = "0x182927F80", Slot = "4")]
void IThreadPoolWorkItem.ExecuteWorkItem()
{
}
// Token: 0x06001CF1 RID: 7409 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6001CF1")]
[Address(RVA = "0x402080", Offset = "0x400E80", VA = "0x180402080", Slot = "5")]
void IThreadPoolWorkItem.MarkAborted(ThreadAbortException tae)
{
}
// Token: 0x04001093 RID: 4243
[global::Cpp2IlInjected.FieldOffset(Offset = "0x58")]
[Token(Token = "0x4001093")]
internal SemaphoreSlim.TaskNode Prev;
// Token: 0x04001094 RID: 4244
[global::Cpp2IlInjected.FieldOffset(Offset = "0x60")]
[Token(Token = "0x4001094")]
internal SemaphoreSlim.TaskNode Next;
}
}
}