Skip to content

Commit

Permalink
Merge branch 'hotfix-1.1.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
John Simons committed Sep 4, 2014
2 parents c0ab6c7 + 0e27c69 commit c174f4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/NServiceBus.RabbitMQ/RabbitMqDequeueStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public void Init(Address address, TransactionSettings transactionSettings, Func<
public void Start(int maximumConcurrencyLevel)
{
tokenSource = new CancellationTokenSource();
countdownEvent = new CountdownEvent(maximumConcurrencyLevel);
// We need to add an extra one because if we fail and the count is at zero already, it doesn't allow us to add one more.
countdownEvent = new CountdownEvent(maximumConcurrencyLevel + 1);

for (var i = 0; i < maximumConcurrencyLevel; i++)
{
Expand All @@ -82,6 +83,7 @@ public void Stop()
}

tokenSource.Cancel();
countdownEvent.Signal();
countdownEvent.Wait();
}

Expand Down

0 comments on commit c174f4b

Please sign in to comment.