Skip to content

Commit

Permalink
task iter does not consume in done call. fixes JuliaLang#6447
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmaykm committed Apr 7, 2014
1 parent 11972c1 commit 44e6c9c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions base/task.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,13 @@ function consume(P::Task, values...)
schedule_and_wait(P)
end

start(t::Task) = nothing
function done(t::Task, val)
start(t::Task) = (istaskstarted(t) || (t.result = consume(t)); return nothing)
done(t::Task, val) = istaskdone(t)
function next(t::Task, val)
result = t.result
t.result = consume(t)
istaskdone(t)
(result, nothing)
end
next(t::Task, val) = (t.result, nothing)


## condition variables
Expand Down

0 comments on commit 44e6c9c

Please sign in to comment.