# Continue a loop in Julia when the time out

**URL:** <https://discourse.julialang.org/t/continue-a-loop-in-julia-when-the-time-out/46002>\
**Category:** General Usage\
**Created:** [September 3, 2020, 12:45pm UTC](https://discourse.julialang.org/t/continue-a-loop-in-julia-when-the-time-out/46002 "2020-09-03T12:45:40Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![MatFi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/matfi/32/10002_2.png) [@MatFi](https://discourse.julialang.org/u/MatFi)\
**Post date:** [September 4, 2020, 9:55am UTC](https://discourse.julialang.org/t/continue-a-loop-in-julia-when-the-time-out/46002/4 "2020-09-04T09:55:09Z")

</div>

see this [post](https://discourse.julialang.org/t/how-to-kill-thread/34236/3)

```julia
...
if istaskdone(tsk1)
    sol = fetch(tsk1)
else 
    schedule(tsk1, ErrorException("stop"), error=true)
    sol = nothing
end

```

will make your example work, but personally I would avoid such a hack

---

_[View the full topic](https://discourse.julialang.org/t/continue-a-loop-in-julia-when-the-time-out/46002)._
