Skip to content

Commit

Permalink
Reexport start_timer, stop_timer
Browse files Browse the repository at this point in the history
Make start_timer validate its arguments.

Ref: discussion in #10885
  • Loading branch information
jiahao committed Apr 20, 2015
1 parent e996f35 commit 438e90b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ Deprecated or removed
`index > length(collection)+1` ([#7373]).

* No longer exported from `Base`:
* `start_timer`, `stop_timer`, `start_reading`, `stop_reading`, `start_watching` ([#10885]).
* `start_reading`, `stop_reading`, `start_watching` ([#10885]).

Julia v0.2.0 Release Notes
==========================
Expand Down
2 changes: 2 additions & 0 deletions base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,8 @@ export
serialize,
skip,
skipchars,
start_timer,
stop_timer,
takebuf_array,
takebuf_string,
truncate,
Expand Down
3 changes: 3 additions & 0 deletions base/stream.jl
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,9 @@ function _uv_hook_asynccb(async::AsyncWork)
end

function start_timer(timer::Timer, timeout::Real, repeat::Real)
timeout 0 || throw(ArgumentError("timer cannot have negative timeout of $timeout seconds"))
repeat 0 || throw(ArgumentError("timer cannot repeat $repeat times"))

associate_julia_struct(timer.handle, timer)
preserve_handle(timer)
ccall(:uv_update_time,Void,(Ptr{Void},),eventloop())
Expand Down

0 comments on commit 438e90b

Please sign in to comment.