summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/system/threads.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/system/threads.nim b/lib/system/threads.nim
index 039a9f2e1..f72395fd2 100644
--- a/lib/system/threads.nim
+++ b/lib/system/threads.nim
@@ -350,7 +350,7 @@ template beforeThreadRuns() =
     threadCreationHandlers[i]()
 
 template afterThreadRuns() =
-  for i in 0..countThreadDestructionHandlers-1:
+  for i in countdown(countThreadDestructionHandlers-1, 0):
     threadDestructionHandlers[i]()
 
 proc runOnThreadCreationHandlers*() =