Skip to content

Commit 4377398

Browse files
committed
Quite likely no need to quiescing multiple times
1 parent c682530 commit 4377398

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

projects/RabbitMQ.Client/ConsumerDispatching/ConsumerDispatcherChannelBase.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ await _writer.WriteAsync(work, cancellationToken)
148148

149149
public void Quiesce()
150150
{
151+
if (IsQuiescing)
152+
{
153+
return;
154+
}
155+
151156
Interlocked.Exchange(ref _isQuiescing, 1);
152157
try
153158
{
@@ -212,12 +217,7 @@ protected bool IsQuiescing
212217
{
213218
get
214219
{
215-
if (Interlocked.Read(ref _isQuiescing) == 1)
216-
{
217-
return true;
218-
}
219-
220-
return false;
220+
return Interlocked.Read(ref _isQuiescing) == 1;
221221
}
222222
}
223223

0 commit comments

Comments
 (0)