Skip to content

Commit 6b5a0ac

Browse files
author
KDr2
committed
don't wait in consume if task is done
1 parent 31e624f commit 6b5a0ac

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/taskcopy.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ consume(p::Task, values...) = begin
174174
isa(p.storage, IdDict) && haskey(p.storage, :_libtask_state) &&
175175
(p.state = p.storage[:_libtask_state])
176176

177+
if p.state == :done
178+
return p.result
179+
end
177180
if p.exception != nothing
178181
throw(p.exception)
179182
end

0 commit comments

Comments
 (0)