Skip to content

Commit

Permalink
Merge pull request #31 from Araq/bugfix
Browse files Browse the repository at this point in the history
critical bugfix
  • Loading branch information
Araq authored Apr 17, 2024
2 parents 32fd877 + 93bec98 commit 3ca95cf
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 @@ -137,13 +137,14 @@ proc worker() {.thread.} =
try:
atomicInc busyThreads
item.t.invoke(item.result)
atomicDec busyThreads
except:
acquire(item.m.L)
if item.m.error.len == 0:
let e = getCurrentException()
item.m.error = "SPAWN FAILURE: [" & $e.name & "] " & e.msg & "\n" & getStackTrace(e)
release(item.m.L)
finally:
atomicDec busyThreads

# but mark it as completed either way!
taskCompleted item.m[]
Expand Down

0 comments on commit 3ca95cf

Please sign in to comment.