Skip to content

Commit

Permalink
Handle new FlushAsync(CancellationToken) overload in SynchronizedText…
Browse files Browse the repository at this point in the history
…Writer.

Closes #120.
  • Loading branch information
alexrp committed Dec 11, 2023
1 parent 512ab6b commit f0d4fef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/common/IO/SynchronizedTextWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ public override async Task FlushAsync()
await _writer.FlushAsync().ConfigureAwait(false);
}

public override async Task FlushAsync(CancellationToken cancellationToken)
{
using (await _lock.EnterAsync(cancellationToken).ConfigureAwait(false))
await _writer.FlushAsync(cancellationToken).ConfigureAwait(false);
}

public override void Write(char value)
{
using (_lock.Enter())
Expand Down

0 comments on commit f0d4fef

Please sign in to comment.