Skip to content

Commit

Permalink
Merge pull request #146 from JuliaGizmos/sd/fix_freeze
Browse files Browse the repository at this point in the history
fix #144
  • Loading branch information
SimonDanisch committed May 30, 2017
2 parents 4303fde + e0c620d commit fd9fd21
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/core.jl
Expand Up @@ -254,8 +254,13 @@ function break_loop()
end

function stop()
global runner_task
run_till_now() # process all remaining events
break_loop()
# it seems to take a long time until the runner_task is actually finished
# which can be enough to run into maybe_restart_queue with !isdone(runner_task)
# see #144
wait(runner_task)
end

"""
Expand Down
7 changes: 5 additions & 2 deletions test/runtests.jl
Expand Up @@ -3,11 +3,14 @@ using FactCheck

# Stop the runner task

if !istaskdone(Reactive.runner_task)

facts("Queue runner") do
@fact istaskdone(Reactive.runner_task) --> false
Reactive.stop()
wait(Reactive.runner_task)
@fact istaskdone(Reactive.runner_task) --> true
end


step() = Reactive.run(1)
queue_size() = Base.n_avail(Reactive._messages)
number() = round(Int, rand()*1000)
Expand Down

0 comments on commit fd9fd21

Please sign in to comment.