Add XML docs

This commit is contained in:
Stone_Red
2025-12-23 15:15:18 +01:00
parent 55f26b3a92
commit 3e339b2b7a
26 changed files with 377 additions and 4 deletions
@@ -1,9 +1,16 @@
namespace RemoteExec.Client;
/// <summary>
/// An async-compatible manual reset event that can be awaited.
/// </summary>
internal class AsyncManualResetEvent
{
private volatile TaskCompletionSource<bool> _tcs = new(TaskCreationOptions.RunContinuationsAsynchronously);
/// <summary>
/// Initializes a new instance of the <see cref="AsyncManualResetEvent"/> class.
/// </summary>
/// <param name="initialState">If true, the event is initially signaled.</param>
public AsyncManualResetEvent(bool initialState)
{
if (initialState)
@@ -12,16 +19,27 @@ internal class AsyncManualResetEvent
}
}
/// <summary>
/// Asynchronously waits for the event to be signaled.
/// </summary>
/// <param name="ct">A cancellation token to cancel the wait operation.</param>
/// <returns>A task that completes when the event is signaled.</returns>
public Task WaitAsync(CancellationToken ct)
{
return _tcs.Task.WaitAsync(ct);
}
/// <summary>
/// Sets the event to a signaled state, releasing all waiting tasks.
/// </summary>
public void Set()
{
_ = _tcs.TrySetResult(true);
}
/// <summary>
/// Resets the event to an unsignaled state.
/// </summary>
public void Reset()
{
while (true)