Skip to content

Commit 49e2703

Browse files
committed
Initialize only failed tasks in reset_threads!
1 parent 5e8bcc6 commit 49e2703

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Polyester.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ Resets the threads used by [Polyester.jl](https://github.com/JuliaSIMD/Polyester
4444
"""
4545
function reset_threads!()
4646
PolyesterWeave.reset_workers!()
47-
foreach(ThreadingUtilities.initialize_task, eachindex(ThreadingUtilities.TASKS))
47+
foreach(eachindex(ThreadingUtilities.TASKS)) do tid
48+
t = ThreadingUtilities.TASKS[tid]
49+
if istaskfailed(t)
50+
ThreadingUtilities.initialize_task(tid)
51+
end
52+
end
4853
return nothing
4954
end
5055
end

0 commit comments

Comments
 (0)