File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
projects/client/RabbitMQ.Client/src/client/impl Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ class WorkPool
45
45
readonly ModelBase _model ;
46
46
CancellationTokenRegistration _tokenRegistration ;
47
47
volatile TaskCompletionSource < bool > _syncSource = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
48
- private Task _task ;
48
+ private Task _worker ;
49
49
50
50
public WorkPool ( ModelBase model )
51
51
{
@@ -57,7 +57,7 @@ public WorkPool(ModelBase model)
57
57
58
58
public void Start ( )
59
59
{
60
- _task = Task . Run ( Loop , CancellationToken . None ) ;
60
+ _worker = Task . Run ( Loop , CancellationToken . None ) ;
61
61
}
62
62
63
63
public void Enqueue ( Work work )
@@ -80,7 +80,7 @@ async Task Loop()
80
80
// Swallowing the task cancellation in case we are stopping work.
81
81
}
82
82
83
- if ( ! _tokenSource . IsCancellationRequested && _workQueue . TryDequeue ( out Work work ) )
83
+ while ( _tokenSource . IsCancellationRequested == false && _workQueue . TryDequeue ( out Work work ) )
84
84
{
85
85
await work . Execute ( _model ) . ConfigureAwait ( false ) ;
86
86
}
You can’t perform that action at this time.
0 commit comments