Skip to content

Commit e79f419

Browse files
authored
Merge pull request #502 from JuliaParallel/jps/precompile-throwto-no-hang
precompile: Don't let throwto hang the root task
2 parents 155a8cd + d5d5246 commit e79f419

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/precompile.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
# Final clean-up
3333
Sch.EAGER_CONTEXT[] = nothing
34-
GC.gc(); yield()
34+
GC.gc(); sleep(0.5)
3535
lock(Sch.ERRORMONITOR_TRACKED) do tracked
3636
if all(t->istaskdone(t) || istaskfailed(t), map(last, tracked))
3737
empty!(tracked)
@@ -40,7 +40,7 @@
4040
for (name, t) in tracked
4141
if t.state == :runnable
4242
@warn "Waiting on $name"
43-
Base.throwto(t, InterruptException())
43+
@async Base.throwto(t, InterruptException())
4444
end
4545
end
4646
end

0 commit comments

Comments
 (0)