Skip to content

Commit c333137

Browse files
committed
Removed Atomic class and added a better ruby-atomic deprecation warning.
1 parent 2c78b44 commit c333137

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

lib/concurrent/atomic.rb

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
#####################################################################
2+
# Attempt to check for the deprecated ruby-atomic gem and warn the
3+
# user that they should use the new implementation instead.
4+
5+
if defined?(Atomic)
6+
warn <<-RUBY
7+
[ATOMIC] Detected an `Atomic` class, which may indicate a dependency
8+
on the ruby-atomic gem. That gem has been deprecated and merged into
9+
the concurrent-ruby gem. Please use the Concurrent::Atomic class for
10+
atomic references and not the Atomic class.
11+
RUBY
12+
end
13+
#####################################################################
14+
115
require 'concurrent/atomic_reference/concurrent_update_error'
216
require 'concurrent/atomic_reference/mutex_atomic'
317

@@ -75,20 +89,3 @@ class Concurrent::Atomic < Concurrent::CAtomic
7589
class Concurrent::Atomic < Concurrent::MutexAtomic
7690
end
7791
end
78-
79-
# @!macro atomic_reference
80-
class Atomic < Concurrent::Atomic
81-
82-
# @!macro concurrent_update_error
83-
ConcurrentUpdateError = Class.new(Concurrent::ConcurrentUpdateError)
84-
85-
# @!macro [attach] atomic_reference_method_initialize
86-
#
87-
# Creates a new Atomic reference with null initial value.
88-
#
89-
# @param [Object] value the initial value
90-
def initialize(value)
91-
warn "[DEPRECATED] Please use Concurrent::Atomic instead."
92-
super
93-
end
94-
end

0 commit comments

Comments
 (0)