Skip to content

Commit

Permalink
fixed bug in awaitAll
Browse files Browse the repository at this point in the history
  • Loading branch information
alob-mtc committed Apr 27, 2023
1 parent a99c483 commit 5421a67
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion eventloop.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ func (e *eventLoop) Run() {

func (e *eventLoop) awaitAll() {
init := true
outer:
for {
n := len(e.promiseQueue)
if init && n == 0 {
Expand All @@ -107,7 +108,7 @@ func (e *eventLoop) awaitAll() {
<-p.done
}
if currentN := int(atomic.LoadInt64(&e.size)); i == 0 && !(currentN > n) {
break
break outer
}
}
// clean up memory (promise)
Expand Down

0 comments on commit 5421a67

Please sign in to comment.