Permalink
Browse files

Don't modify Thread.abort_on_exception

Closes #332.
  • Loading branch information...
1 parent 41f07f7 commit 6de998ced1f3dce97a24e500ecf2348192ae9316 @sferik committed Dec 7, 2012
Showing with 4 additions and 16 deletions.
  1. +4 −16 lib/twitter/core_ext/enumerable.rb
@@ -1,23 +1,11 @@
module Enumerable
def threaded_map
- abort_on_exception do
- threads = []
- each do |object|
- threads << Thread.new { yield object }
- end
- threads.map(&:value)
+ threads = []
+ each do |object|
+ threads << Thread.new { yield object }
end
- end
-
-private
-
- def abort_on_exception
- initial_abort_on_exception = Thread.abort_on_exception
- Thread.abort_on_exception ||= true
- yield
- ensure
- Thread.abort_on_exception = initial_abort_on_exception
+ threads.map(&:value)
end
end

0 comments on commit 6de998c

Please sign in to comment.