mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
284a9ba8ec
The concurrent-ruby gem is a toolset containing many concurrency utilities. Many of these utilities include runtime-specific optimizations when possible. Rather than clutter the Rails codebase with concurrency utilities separate from the core task, such tools can be superseded by similar tools in the more specialized gem. This commit replaces `ActiveSupport::Concurrency::Latch` with `Concurrent::CountDownLatch`, which is functionally equivalent.
19 lines
431 B
Ruby
19 lines
431 B
Ruby
require 'concurrent/atomics'
|
|
|
|
module ActiveSupport
|
|
module Concurrency
|
|
class Latch < Concurrent::CountDownLatch
|
|
|
|
def initialize(count = 1)
|
|
ActiveSupport::Deprecation.warn("ActiveSupport::Concurrency::Latch is deprecated. Please use Concurrent::CountDownLatch instead.")
|
|
super(count)
|
|
end
|
|
|
|
alias_method :release, :count_down
|
|
|
|
def await
|
|
wait(nil)
|
|
end
|
|
end
|
|
end
|
|
end
|