File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
activesupport/lib/active_support/concurrency Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 22
33module ActiveSupport
44 module Concurrency
5- class Latch < Concurrent :: CountDownLatch
5+ class Latch
66
77 def initialize ( count = 1 )
8- ActiveSupport ::Deprecation . warn ( "ActiveSupport::Concurrency::Latch is deprecated. Please use Concurrent::CountDownLatch instead." )
9- super ( count )
8+ if count == 1
9+ ActiveSupport ::Deprecation . warn ( "ActiveSupport::Concurrency::Latch is deprecated. Please use Concurrent::Event instead." )
10+ else
11+ ActiveSupport ::Deprecation . warn ( "ActiveSupport::Concurrency::Latch is deprecated. Please use Concurrent::CountDownLatch instead." )
12+ end
13+
14+ @inner = Concurrent ::CountDownLatch . new ( count )
1015 end
1116
12- alias_method :release , :count_down
17+ def release
18+ @inner . count_down
19+ end
1320
1421 def await
15- wait ( nil )
22+ @inner . wait ( nil )
1623 end
1724 end
1825 end
You can’t perform that action at this time.
0 commit comments