diff options
Diffstat (limited to 'lib/system/threads.nim')
-rw-r--r-- | lib/system/threads.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/system/threads.nim b/lib/system/threads.nim index 2434ea21e..aaf0164fd 100644 --- a/lib/system/threads.nim +++ b/lib/system/threads.nim @@ -393,8 +393,9 @@ proc onThreadDestruction*(handler: proc () {.closure, gcsafe.}) = ## A thread is destructed when the ``.thread`` proc returns ## normally or when it raises an exception. Note that unhandled exceptions ## in a thread nevertheless cause the whole process to die. - if threadDestructionHandlers.isNil: - threadDestructionHandlers = @[] + when not defined(nimNoNilSeqs): + if threadDestructionHandlers.isNil: + threadDestructionHandlers = @[] threadDestructionHandlers.add handler template afterThreadRuns() = |