Skip to content

Commit

Permalink
Merge pull request #19 from Araq/araq-opt
Browse files Browse the repository at this point in the history
only notify master if runningTasks == 0
  • Loading branch information
Araq authored Aug 29, 2023
2 parents 696debe + 1de9f38 commit f982cbc
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 f982cbc

Please sign in to comment.