Skip to content

Commit

Permalink
Simplify logic for channel exception (#35673)
Browse files Browse the repository at this point in the history
This was a simplification missed in original #35177
  • Loading branch information
non-Jedi authored May 1, 2020
1 parent 1a19176 commit 2a29aae
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions base/channels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,9 @@ function close_chnl_on_taskdone(t::Task, c::Channel)
lock(c)
try
isopen(c) || return
if istaskfailed(t)
excp = task_result(t)
if excp isa Exception
close(c, TaskFailedException(t))
return
end
if istaskfailed(t) && task_result(t) isa Exception
close(c, TaskFailedException(t))
return
end
close(c)
finally
Expand Down

0 comments on commit 2a29aae

Please sign in to comment.