mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
19 lines
441 B
Ruby
19 lines
441 B
Ruby
require 'concurrent/atomic/count_down_latch'
|
|
|
|
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
|