Skip to content

Commit

Permalink
only notify master if runningTasks == 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq committed Aug 29, 2023
1 parent 696debe commit 1de9f38
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/malebolgia.nim
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ proc taskCreated(m: var Master) {.inline.} =
proc taskCompleted(m: var Master) {.inline.} =
acquire(m.L)
dec m.runningTasks
signal(m.c)
if m.runningTasks == 0:
signal(m.c)
release(m.L)

proc stillHaveTime*(m: Master): bool {.inline.} =
Expand Down

0 comments on commit 1de9f38

Please sign in to comment.