Skip to content

Commit

Permalink
Fix threads going below zero
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Nov 3, 2024
1 parent a2f52e6 commit ce83266
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,11 @@ private void handleInput()

for (int i = 0; i < 2; i++)
{
connections.TryDequeue(out var connection);
connection!.Dispose();
if (Threads > connections.Count)
{
connections.TryDequeue(out var connection);
connection!.Dispose();
}
}

break;
Expand Down

0 comments on commit ce83266

Please sign in to comment.