Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref #12473, avoid swallowing other Timer callback errors #12591

Merged
merged 1 commit into from
Aug 14, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions base/stream.jl
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ function _uv_hook_close(t::Timer)
unpreserve_handle(t)
disassociate_julia_struct(t)
t.handle = C_NULL
t.isopen = false
notify_error(t.cond, EOFError())
nothing
end
Expand All @@ -621,12 +622,15 @@ end
function Timer(cb::Function, timeout::Real, repeat::Real=0.0)
t = Timer(timeout, repeat)
@schedule begin
try
while isopen(t)
while isopen(t)
success = try
wait(t)
cb(t)
true
catch # ignore possible exception on close()
false
end
end # ignore possible exception on close()
success && cb(t)
end
end
t
end
Expand Down