Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def shutdown
def kill
synchronize do
@executor.shutdownNow
wait_for_termination
nil
end
end
Expand Down
5 changes: 4 additions & 1 deletion lib/concurrent-ruby/concurrent/executor/timer_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def post(delay, *args, &task)
# not running.
def kill
shutdown
@timer_executor.kill
end

private :<<
Expand Down Expand Up @@ -122,7 +123,9 @@ def remove_task(task)
def ns_shutdown_execution
ns_reset_if_forked
@queue.clear
@timer_executor.kill
@condition.set
@condition.reset
@timer_executor.shutdown
stopped_event.set
end

Expand Down
2 changes: 1 addition & 1 deletion spec/concurrent/executor/timer_set_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ module Concurrent
expect(task.schedule_time).to eq expected
end

it 'reschdules a pending and unpost task when given a valid time' do
it 'reschedules a pending and unpost task when given a valid time' do
initial_delay = 10
rescheduled_delay = 20
task = subject.post(initial_delay){ nil }
Expand Down