Skip to content

Commit

Permalink
Update base/channels.jl
Browse files Browse the repository at this point in the history
Co-authored-by: Takafumi Arakaki <[email protected]>
  • Loading branch information
c42f and tkf authored Nov 6, 2021
1 parent ac0a4ae commit c203a3f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions base/channels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ function put_buffered(c::Channel, v)
# notify all, since some of the waiters may be on a "fetch" call.
notify(c.cond_take, nothing, true, false)
finally
# Decrement the available items if this task had an exception before pushing the
# item to the buffer (e.g., during `wait(c.cond_put)`):
did_buffer || _increment_n_avail(c, -1)
unlock(c)
end
Expand Down

0 comments on commit c203a3f

Please sign in to comment.