Skip to content

Commit

Permalink
fix swow wait group counter can not negative
Browse files Browse the repository at this point in the history
  • Loading branch information
chaz6chez committed Nov 20, 2024
1 parent bce4f36 commit b32de58
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Utils/WaitGroup/Handlers/SwowWaitGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ public function add(int $delta = 1): bool
/** @inheritdoc */
public function done(): bool
{
$this->_waitGroup->done();
$this->_count--;
if ($this->count() > 0) {
$this->_waitGroup->done();
$this->_count--;
}

return true;
}
Expand Down

0 comments on commit b32de58

Please sign in to comment.