Skip to content

Commit a24bff9

Browse files
committed
Refactor signal handling in RichTextBoxSink to improve thread synchronization
1 parent 9e5570e commit a24bff9

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

Serilog.Sinks.RichTextBox.WinForms.Colored/Sinks/RichTextBoxForms/RichTextBoxSink.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ private void ProcessMessages(CancellationToken token)
111111
while (!token.IsCancellationRequested)
112112
{
113113
_signal.WaitOne();
114-
115114
if (token.IsCancellationRequested)
116115
{
117116
break;
@@ -128,12 +127,8 @@ private void ProcessMessages(CancellationToken token)
128127
}
129128
}
130129

131-
while (_signal.WaitOne(0))
132-
{
133-
}
134-
130+
_signal.Reset();
135131
_buffer.TakeSnapshot(snapshot);
136-
137132
builder.Clear();
138133
foreach (var evt in snapshot)
139134
{

0 commit comments

Comments
 (0)