Skip to content

Commit 438e90b

Browse files
committed
Reexport start_timer, stop_timer
Make start_timer validate its arguments. Ref: discussion in #10885
1 parent e996f35 commit 438e90b

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ Deprecated or removed
738738
`index > length(collection)+1` ([#7373]).
739739

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

743743
Julia v0.2.0 Release Notes
744744
==========================

base/exports.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,8 @@ export
11711171
serialize,
11721172
skip,
11731173
skipchars,
1174+
start_timer,
1175+
stop_timer,
11741176
takebuf_array,
11751177
takebuf_string,
11761178
truncate,

base/stream.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,9 @@ function _uv_hook_asynccb(async::AsyncWork)
502502
end
503503

504504
function start_timer(timer::Timer, timeout::Real, repeat::Real)
505+
timeout 0 || throw(ArgumentError("timer cannot have negative timeout of $timeout seconds"))
506+
repeat 0 || throw(ArgumentError("timer cannot repeat $repeat times"))
507+
505508
associate_julia_struct(timer.handle, timer)
506509
preserve_handle(timer)
507510
ccall(:uv_update_time,Void,(Ptr{Void},),eventloop())

0 commit comments

Comments
 (0)