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 2
2
3
3
module ActiveSupport
4
4
module Concurrency
5
- class Latch < Concurrent :: CountDownLatch
5
+ class Latch
6
6
7
7
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 )
10
15
end
11
16
12
- alias_method :release , :count_down
17
+ def release
18
+ @inner . count_down
19
+ end
13
20
14
21
def await
15
- wait ( nil )
22
+ @inner . wait ( nil )
16
23
end
17
24
end
18
25
end
You can’t perform that action at this time.
0 commit comments