aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2012-09-18 15:22:13 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2012-09-18 15:22:24 -0700
commitaebbd4bb4d2bb5a461d5ec70dd27e5cb832d6869 (patch)
treeed8949cc1ec5c35b892252f47cd2276b23d375a1 /activesupport
parent96e713b02bc46859cef31c20e506fdccb397112f (diff)
downloadrails-aebbd4bb4d2bb5a461d5ec70dd27e5cb832d6869.tar.gz
rails-aebbd4bb4d2bb5a461d5ec70dd27e5cb832d6869.tar.bz2
rails-aebbd4bb4d2bb5a461d5ec70dd27e5cb832d6869.zip
No need to defensively work jobs in another thread
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/queueing.rb2
-rw-r--r--activesupport/test/queueing/test_queue_test.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/queueing.rb b/activesupport/lib/active_support/queueing.rb
index d36b5c17a8..0a4ab05b78 100644
--- a/activesupport/lib/active_support/queueing.rb
+++ b/activesupport/lib/active_support/queueing.rb
@@ -110,7 +110,7 @@ module ActiveSupport
end
def drain
- Thread.new { run(@queue.pop) until @queue.empty? }.join
+ run(@queue.pop) until @queue.empty?
end
def consume
diff --git a/activesupport/test/queueing/test_queue_test.rb b/activesupport/test/queueing/test_queue_test.rb
index 9e74bc64ee..e398a48bea 100644
--- a/activesupport/test/queueing/test_queue_test.rb
+++ b/activesupport/test/queueing/test_queue_test.rb
@@ -97,6 +97,6 @@ class TestQueueTest < ActiveSupport::TestCase
assert @queue.empty?
assert job.ran?, "The job runs synchronously when the queue is drained"
- assert_not_equal job.thread_id, Thread.current.object_id
+ assert_equal job.thread_id, Thread.current.object_id
end
end